[hidden] {
  display: none !important;
}
:root {
  color-scheme: dark;
  --bg: #07121f;
  --panel: #0e1d2c;
  --line: #253b4c;
  --text: #eff7ff;
  --muted: #a5b8c9;
  --cyan: #3ce0e7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 75% 5%, #11405088, transparent 40%), var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
}
header,
main,
footer {
  max-width: 1360px;
  margin: auto;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px 32px;
  border-bottom: 1px solid var(--line);
}
header img {
  object-fit: contain;
  max-width: 180px;
  height: auto;
}
a {
  color: var(--cyan);
  text-decoration: none;
}
.back {
  font-size: 0.9rem;
}
main {
  padding: 55px 32px;
}
.eyebrow {
  color: var(--cyan);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  font-weight: bold;
  display: inline-flex;
  gap: 9px;
  align-items: center;
}
.eyebrow i {
  width: 7px;
  height: 7px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 14px var(--cyan);
}
h1 {
  font-size: clamp(2.6rem, 5vw, 4.7rem);
  letter-spacing: -0.055em;
  line-height: 1.07;
  margin: 20px 0;
}
em {
  font-style: normal;
  color: var(--cyan);
}
.intro > p {
  max-width: 670px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.08rem;
}
.pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 24px 0 40px;
}
.pills span,
.tag {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  font-size: 0.72rem;
  color: #c4d8e6;
}
.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: #0c1928;
}
.controls {
  padding: 28px;
  border-right: 1px solid var(--line);
  background: #0d1c2b;
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
}
.step:first-child {
  margin-top: 0;
}
.step b {
  color: var(--cyan);
  font-size: 0.72rem;
}
.step h2 {
  font-size: 1rem;
  margin: 0;
}
.upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  border: 1px dashed #3f7b91;
  border-radius: 14px;
  padding: 20px 12px;
  background: #102f3c88;
  cursor: pointer;
}
.upload-icon {
  font-size: 2rem;
  color: var(--cyan);
}
.upload strong {
  font-size: 0.85rem;
}
.upload small,
.privacy,
.hint {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.65;
}
.upload input {
  width: 100%;
  font-size: 0.7rem;
}
.privacy {
  font-size: 0.7rem;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
legend {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
}
.option:has(input:checked) {
  border-color: var(--cyan);
  background: #0a434a44;
}
.option span {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.83rem;
}
.option small {
  color: var(--muted);
  font-size: 0.72rem;
}
input {
  accent-color: var(--cyan);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.76rem;
  margin: 17px 0;
  color: #d5e7f2;
}
select {
  padding: 12px;
  background: #071625;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
}
button {
  font: inherit;
  font-size: 0.8rem;
  border-radius: 9px;
  padding: 13px 15px;
  min-height: 44px;
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: bold;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.primary {
  background: var(--cyan);
  color: #06202b;
}
.secondary {
  background: transparent;
  color: var(--text);
  border-color: #496073;
}
.text-button {
  background: transparent;
  color: var(--cyan);
  font-size: 0.74rem;
}
.controls button {
  width: 100%;
}
#status {
  font-size: 0.76rem;
  line-height: 1.6;
  min-height: 2.8em;
  color: var(--cyan);
}
#status.error {
  color: #ffb4a8;
}
.preview-area {
  padding: 32px;
  min-width: 0;
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 30px;
}
.preview-head h2 {
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  margin: 10px 0;
}
.preview-grid {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.5fr);
  gap: 26px;
}
h3 {
  font-size: 0.85rem;
  margin: 0 0 17px;
}
.canvas-wrap {
  position: relative;
  background: #102b3c;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  min-height: 220px;
}
.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}
#empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  color: #7396ac;
  font-size: 1rem;
  line-height: 1.6;
}
.sheet-wrap {
  padding: 14px;
  border-radius: 12px;
  background: #203142;
  box-shadow: 0 15px 40px #0003;
}
.sheet-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}
.export {
  margin: 35px 0 24px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}
.export p,
.notice p {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.7;
  max-width: 360px;
}
.download-buttons {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 185px;
}
.notice {
  padding: 18px 20px;
  background: #122537;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.8rem;
}
.notice p {
  max-width: none;
  margin-bottom: 0;
}
.how {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  padding: 55px 0 15px;
}
.how article {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.how span {
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  color: var(--cyan);
}
.how h2 {
  font-size: 1.4rem;
  line-height: 1.2;
}
.how p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.7;
}
footer {
  border-top: 1px solid var(--line);
  padding: 30px 32px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.8rem;
}
footer span {
  color: var(--muted);
}
:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}
@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: 280px minmax(0, 1fr);
  }
  .preview-area {
    padding: 24px;
  }
  .preview-grid {
    grid-template-columns: 1fr;
  }
  .portrait-panel .canvas-wrap {
    max-width: 160px;
    min-height: 0;
  }
  .export {
    flex-direction: column;
  }
}
@media (max-width: 720px) {
  header {
    padding: 20px;
  }
  header img {
    max-width: 145px;
  }
  main {
    padding: 35px 18px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .controls {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 24px;
  }
  .preview-area {
    padding: 22px;
  }
  .preview-head {
    align-items: start;
  }
  .preview-head h2 {
    font-size: 1.2rem;
  }
  .preview-grid {
    grid-template-columns: minmax(80px, 0.65fr) minmax(0, 1.3fr);
    gap: 15px;
  }
  .canvas-wrap {
    min-height: 0;
  }
  .sheet-wrap {
    padding: 7px;
  }
  .how {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .tag {
    white-space: nowrap;
    font-size: 0.65rem;
  }
  .download-buttons {
    min-width: 0;
  }
  footer {
    padding: 25px 20px;
  }
}

.crop-float{position:fixed;right:24px;top:110px;width:240px;z-index:1000;padding:12px;background:#0b1c2ff5;border:1px solid #3ce0e788;border-radius:16px;box-shadow:0 18px 70px #0009;backdrop-filter:blur(14px)}
.crop-float-head{display:flex;align-items:center;justify-content:space-between;font-size:.8rem;gap:10px;margin-bottom:8px}.crop-float-head button{background:transparent;color:#dffaff;font-size:1.3rem;padding:0;min-width:44px;min-height:44px}.crop-float canvas{display:block;max-width:100%;max-height:50vh;width:auto;height:auto;margin:auto;border-radius:8px}.crop-float p{display:flex;justify-content:space-between;gap:8px;font-size:.72rem;color:#bed3e0;margin:12px 0 0}.crop-float p span:first-child{color:#3ce0e7;font-weight:bold}#zoom-value{color:var(--cyan);font-variant-numeric:tabular-nums}
@media(max-width:720px){.crop-float{right:12px;top:75px;width:144px;padding:9px;border-radius:12px}.crop-float-head{font-size:.65rem;gap:0}.crop-float-head button{min-width:36px;min-height:36px}.crop-float canvas{max-height:28vh}.crop-float p{font-size:.6rem;flex-wrap:wrap;margin-top:8px}}
