:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #191919;
  background: #f6f6f3;
  --muted: #575751;
  --line: #d8d8d0;
}
* { box-sizing: border-box; }
body { margin: 0; }
header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.3rem max(5vw, 1rem);
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.brand { font-weight: 850; letter-spacing: .14em; }
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
  max-width: 1220px;
  margin: auto;
  padding: clamp(2rem, 7vw, 6rem) max(5vw, 1rem);
}
#workspace.showing-result {
  grid-template-columns: minmax(0, 1fr);
  max-width: 760px;
  gap: 1.5rem;
}
#result-actions { text-align: center; }
#result-actions h2 { margin: 0 0 .85rem; font-size: 1.25rem; }
#result-notice { color: var(--muted); }
#result-notice:empty { display: none; }
#save-to-cabinet:not([hidden]) { margin-bottom: 1.2rem; }
header { flex-wrap: wrap; }
.header-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-left: auto; }
dialog { width: min(92vw, 650px); max-height: 84vh; padding: 1.25rem; border: 1px solid var(--line); border-radius: .8rem; }
dialog::backdrop { background: #0007; }
.cabinet-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cabinet-heading h2 { margin: 0; }
dialog input:not([type="checkbox"]) { display: block; width: 100%; margin: .5rem 0; padding: .65rem; font: inherit; }
dialog form, #sign-out { margin-top: 1rem; }
.gallery-sharing { margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.gallery-sharing label { display: flex; align-items: baseline; gap: .4rem; font-size: .9rem; }
.gallery-sharing p { margin: .35rem 0 0; }
.gallery-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.gallery-actions button { padding: .45rem .65rem; font-size: .875rem; }
.gallery-vote { background: white; color: #191919; }
.gallery-vote[aria-pressed="true"] { background: #ecebe5; }
#gallery-order:not([hidden]) { margin-bottom: 1rem; padding: .8rem; border: 1px solid var(--line); border-radius: .5rem; }
.cabinet-designs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: .8rem; }
.cabinet-designs article { border: 1px solid var(--line); padding: .65rem; border-radius: .5rem; }
.cabinet-designs img { width: 100%; height: auto; display: block; }
.cabinet-designs a { color: inherit; }
h1 {
  font-size: clamp(2.6rem, 5.6vw, 5.2rem);
  line-height: .99;
  letter-spacing: -.06em;
  margin: 0;
}
.intro { color: var(--muted); line-height: 1.6; margin: 1.3rem 0 2rem; }
label { display: block; margin-bottom: .65rem; font-weight: 650; }
textarea, #primary-text, #secondary-text, #nfc-url {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: white;
  color: inherit;
  padding: .9rem;
  font: inherit;
  line-height: 1.5;
}
textarea { resize: vertical; }
[aria-invalid="true"] { outline: 2px solid #a53129; outline-offset: 2px; }
.field-hint { color: var(--muted); font-size: .875rem; font-weight: 400; }
p.field-hint { margin: .4rem 0 0; }
button {
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  padding: .7rem 1rem;
  border: 1px solid #191919;
  border-radius: .55rem;
  color: white;
  background: #191919;
}
#generate { margin-top: .85rem; width: 100%; }
.style-label { margin-top: .85rem; }
#style, #logo-position, #nfc-action {
  width: 100%;
  padding: .65rem .9rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: white;
  color: inherit;
  font: inherit;
}
#logo-file { max-width: 100%; font: inherit; }
.logo-options { margin-top: .75rem; }
.logo-options label { margin: .6rem 0; }
#remove-logo { margin-top: .6rem; background: white; color: #191919; }
#logo-preview {
  display: block;
  width: 100%;
  height: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: .55rem;
}
button:disabled { opacity: .52; cursor: default; }
:focus-visible { outline: 2px solid #305eb0; outline-offset: 3px; }
#status { min-height: 3em; color: var(--muted); line-height: 1.5; }
#generation-progress { width: 100%; accent-color: #191919; }
.preview {
  background: white;
  border: 1px solid var(--line);
  border-radius: .85rem;
  overflow: hidden;
}
.preview-heading, .preview-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: 1rem;
}
.preview h2 { font-size: 1rem; margin: 0; }
.preview span { color: var(--muted); font-size: .875rem; }
.stage { display: grid; place-items: center; background: #eaeae5; padding: 8%; }
#artwork {
  display: block;
  width: 100%;
  max-width: 440px;
  height: auto;
  border-radius: 50%;
  box-shadow: 0 4px 15px #0002;
}
.visualization { border-top: 1px solid var(--line); }
.photo-first { display: flex; flex-direction: column; }
.photo-first > .visualization { order: -1; border-top: 0; border-bottom: 1px solid var(--line); }
.visualization-status { color: var(--muted); margin: 0 1rem 1rem; }
.visualization-status:empty { display: none; }
#visualization-progress { width: calc(100% - 2rem); margin: 0 1rem 1rem; accent-color: #191919; }
#coaster-mockup:not([hidden]) { display: block; width: 100%; height: auto; }
#download { background: white; color: #191919; }
.frame-option {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  font-size: .875rem;
  cursor: pointer;
}
.frame-option input { accent-color: #191919; }
.form-frame { margin-top: .85rem; }
#nfc-options { min-width: 0; margin: .85rem 0 0; padding: .85rem; border: 1px solid var(--line); border-radius: .55rem; }
#nfc-options label { margin-top: .65rem; }
#nfc-badge-preview { display: block; width: 96px; height: auto; margin: .8rem auto; }
@media (max-width: 760px) {
  main { grid-template-columns: 1fr; gap: 1rem; }
}
