/* VISUAL: cores e espaçamento ficam aqui; medidas de impressão ficam em config.js. */
:root {
  --ink: #343b37;
  --muted: #7d827c;
  --paper: #fbf8f2;
  --coral: #df6573;
  --dark-coral: #c34b5a;
  --line: #e9e7df;
  --green: #4c6c5b;
  --soft: #f3f4ed;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.45;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #6b9a8c;
  outline-offset: 3px;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #e5a5ad;
  outline-offset: 0;
}
a {
  color: inherit;
}
button {
  color: inherit;
}
h1,
h2,
p {
  margin: 0;
}
button {
  border: 0;
  background: none;
}
button,
select {
  min-height: 38px;
}
.topbar {
  height: 94px;
  padding: 0 42px;
  display: flex;
  align-items: center;
  gap: 30px;
  border-bottom: 1px solid var(--line);
  background: #fffdf9;
}
.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.brand-logo {
  display: block;
  width: 100px;
  height: 40px;
  object-fit: contain;
}
.studio-badge {
  font-size: 10px;
  letter-spacing: 1.7px;
  color: var(--muted);
  margin-left: 28px;
  border-left: 1px solid var(--line);
  padding-left: 28px;
}
.studio-badge span {
  color: #c4a061;
  margin-left: 8px;
}
.header-actions {
  margin-left: auto;
  display: flex;
  gap: 12px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 9px;
  padding: 13px 20px;
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
  transition: 0.15s;
}
.button.primary {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 3px 0 #bd49552b;
}
.button.primary:hover {
  background: var(--dark-coral);
}
.button.quiet {
  background: #f1efe7;
}
.button.outline {
  border: 1px solid var(--line);
  background: white;
}
.wide {
  width: 100%;
  margin-top: 12px;
}
.welcome {
  max-width: 1540px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 39px 42px 31px;
}
.eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #a87862;
  margin-bottom: 11px;
}
h1 {
  font-family: Georgia, serif;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -1px;
  line-height: 1.2;
}
h1 em {
  color: var(--coral);
  font-weight: 400;
}
.welcome p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}
.welcome-note {
  display: flex;
  align-items: center;
  gap: 15px;
  font: italic 16px/1.5 Georgia;
  color: #8b907b;
  margin-right: 18px;
}
.spark {
  font-size: 53px;
  color: #e7bb57;
  font-style: normal;
}
.projectbar {
  display: flex;
  gap: 18px;
  align-items: center;
  margin: 0 42px 15px;
  font-size: 11px;
}
.project-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}
.project-title input {
  border: 0;
  background: transparent;
  width: 210px;
  font-weight: 600;
  padding: 5px;
}
.project-title span {
  color: #aeb3a9;
}
.projectbar #save-status {
  margin-left: auto;
  color: var(--muted);
}
.link-button {
  font-size: 11px;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 0;
}
.round-button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border: 1px solid #d9ded3;
  border-radius: 50%;
  background: white;
  font-size: 15px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 280px;
  margin: 0 42px;
  min-height: 650px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: white;
  box-shadow: 0 6px 30px #383a2905;
}
.panel {
  padding: 23px 20px;
  background: #fffdf9;
}
.library {
  border-right: 1px solid var(--line);
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 21px;
}
.panel-heading h2 {
  font-size: 13px;
  font-weight: 650;
}
.panel-heading > span {
  font: italic 15px Georgia;
  color: #bcc0ac;
}
.import-card {
  width: 100%;
  border: 1px dashed #cccfbf;
  border-radius: 10px;
  padding: 16px 8px;
  background: #f7f8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.import-card:hover {
  background: #eff2e5;
}
.import-icon {
  font-size: 22px;
  color: var(--green);
  line-height: 1;
}
.import-card b {
  font-size: 11px;
  font-weight: 600;
}
.import-card small {
  font-size: 9px;
  color: var(--muted);
}
.section-label {
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #949987;
  font-weight: 650;
  margin: 24px 0 13px;
}
.template-list {
  display: grid;
  gap: 10px;
}
.template-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  display: flex;
  align-items: center;
  text-align: left;
  padding: 8px;
  gap: 10px;
  width: 100%;
}
.template-card.selected {
  border-color: #dea19f;
  background: #fff5f2;
}
.template-image {
  height: 62px;
  width: 62px;
  border-radius: 6px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  padding: 5px;
  overflow: hidden;
}
.template-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}
.pink {
  background: #f8e3e6;
}
.peach {
  background: #f5e5d8;
}
.mint {
  background: #edf1e1;
}
.mint span {
  text-align: center;
  color: #d98b70;
  font-size: 12px;
  line-height: 13px;
}
.mint b {
  font: italic 11px Georgia;
  color: #617b60;
}
.template-card > span {
  display: grid;
  gap: 5px;
}
.template-card b {
  font-size: 11px;
  font-weight: 600;
}
.template-card small {
  font-size: 8px;
  color: var(--muted);
  line-height: 1.4;
}
.template-card i {
  font-style: normal;
  color: #abae9c;
  font-size: 15px;
  margin-left: auto;
}
.sample-link {
  font-size: 10px;
  color: var(--green);
  display: block;
  margin-top: 17px;
  text-underline-offset: 3px;
}
.library-note {
  margin-top: 31px;
  background: #f7f3e8;
  padding: 17px 14px;
  border-radius: 8px;
}
.library-note b {
  font: italic 15px Georgia;
  color: #77785e;
}
.library-note p {
  font-size: 10px;
  color: #989785;
  line-height: 1.8;
  margin-top: 9px;
}
.canvas-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #f0f0e8;
}
.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
  height: 57px;
  background: #ffffffd9;
  border-bottom: 1px solid var(--line);
  padding: 0 15px;
}
.tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tool-button {
  border-radius: 5px;
  font-size: 22px;
  min-width: 32px;
  padding: 4px 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.tool-button:hover {
  background: #f0eee6;
}
.tool-button.labeled {
  font-size: 17px;
}
.tool-button.labeled > span:last-child {
  font-size: 10px;
}
.tool-button b {
  font: 17px Georgia;
}
.separator {
  height: 18px;
  border-right: 1px solid var(--line);
  margin: 0 6px;
}
#zoom-label {
  font-size: 9px;
  color: var(--muted);
  min-width: 35px;
  text-align: center;
}
.canvas-area {
  padding: 33px 25px 25px;
  flex: 1;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  background-image: radial-gradient(#b3b8a72b 0.8px, transparent 0.8px);
  background-size: 13px 13px;
  overflow: auto;
  min-height: 450px;
}
.art-label {
  width: min(100%, 360px);
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: #909786;
  letter-spacing: 1.4px;
  margin: 0 0 20px;
}
.art-label > span:last-child {
  letter-spacing: 0.2px;
}
.artboard-host {
  width: min(100%, 350px);
  position: relative;
  line-height: 0;
  box-shadow: 0 12px 30px #41483920;
  user-select: none;
  background: white;
  max-width: 100%;
  flex-shrink: 0;
}
.artboard-host svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  overflow: visible;
}
.artboard-host[data-circle="true"] {
  border-radius: 50%;
  background: transparent;
}
.canvas-tip {
  font-size: 9px;
  color: #969c8c;
  line-height: 1.7;
  text-align: center;
  margin-top: 27px;
  max-width: 290px;
}
.pagebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #f9f9f2;
  border-top: 1px solid #e1e5d8;
  font-size: 9px;
  gap: 8px;
}
.pagebar #page-list {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.pagebar button {
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 9px;
  padding: 2px 9px;
  min-height: 27px;
  background: white;
}
.pagebar button.active {
  border-color: #c47b83;
  color: #b55460;
  background: #fcf1ee;
}
.canvas-bottom {
  background: #fdfdf8;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  font-size: 10px;
  min-height: 49px;
}
.canvas-bottom button {
  margin-left: auto;
  white-space: nowrap;
}
.green-dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  background: #8eae77;
  border-radius: 50%;
  flex-shrink: 0;
}
.settings {
  border-left: 1px solid var(--line);
  max-height: 780px;
  overflow: auto;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 10px;
  color: #6c7369;
  margin-bottom: 15px;
  font-weight: 500;
}
.field input:not([type="color"]),
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #dedfd6;
  border-radius: 6px;
  background: #fff;
  padding: 10px;
  color: var(--ink);
  font-size: 11px;
  min-height: 37px;
}
.field input[type="color"] {
  border: 1px solid #dedfd6;
  border-radius: 6px;
  width: 100%;
  height: 37px;
  background: white;
  padding: 4px;
}
.field textarea {
  resize: vertical;
}
.field-row {
  display: flex;
  gap: 10px;
}
.field-row > .field {
  flex: 1;
  min-width: 0;
}
.field-row > .small {
  max-width: 83px;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
.settings .section-label {
  margin-top: 0;
  font-size: 8px;
}
.muted,
.hint {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}
.mini-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mini-actions button,
.mini-actions a {
  font-size: 10px;
  border: 1px solid var(--line);
  padding: 6px 9px;
  border-radius: 6px;
  min-height: 31px;
  text-decoration: none;
  background: #fff;
}
.mini-actions .danger {
  color: #bf5b65;
}
.paper-settings summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 17px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  margin: 2px 0 15px;
  color: #6c7369;
}
.check-row input {
  accent-color: var(--coral);
  width: 15px;
  height: 15px;
}
.paper-settings .field {
  font-size: 9px;
}
.paper-settings .hint {
  font-size: 9px;
}
footer {
  padding: 24px 42px 29px;
  display: flex;
  justify-content: space-between;
  color: #a4a793;
  font-size: 10px;
}
footer > span:last-child {
  font: italic 13px Georgia;
}
.footer-flower {
  color: #bdbd8b;
  margin-left: 15px;
}
.mobile-tabs {
  display: none;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 29px;
  max-width: 480px;
  width: calc(100% - 30px);
  max-height: 90dvh;
  color: var(--ink);
  box-shadow: 0 30px 90px #182d2440;
}
dialog::backdrop {
  background: #263b3455;
  backdrop-filter: blur(4px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 16px;
}
.dialog-head h2 {
  font: 26px Georgia;
}
.dialog-head .eyebrow {
  font-size: 8px;
}
dialog > p,
dialog li {
  font-size: 12px;
  line-height: 1.8;
  color: #747c70;
}
dialog ol {
  padding-left: 20px;
}
dialog li {
  margin: 12px 0;
}
.export-spec {
  padding: 15px;
  background: #f5f5e9;
  border-radius: 9px;
  margin: 18px 0 4px;
  font-size: 11px;
  line-height: 1.8;
}
.link-share {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 17px;
  font-size: 12px;
}
.link-share summary {
  cursor: pointer;
  margin-bottom: 10px;
}
#pdf-url {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  margin: 12px 0;
  font-size: 11px;
}
#export-message {
  font-size: 11px;
  color: var(--dark-coral);
  margin-top: 14px;
}
#sheet-preview {
  background: #e6e9df;
  display: grid;
  place-items: center;
  padding: 15px;
}
#sheet-preview svg {
  width: 100%;
  max-height: 60vh;
  background: white;
  box-shadow: 0 3px 13px #3332;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  z-index: 40;
  color: white;
  background: #364d43;
  border-radius: 10px;
  padding: 14px 21px;
  font-size: 12px;
  max-width: 90vw;
  transition: transform 0.2s;
  pointer-events: none;
}
#toast.visible {
  transform: translateX(-50%) translateY(0);
}
#busy:not([hidden]) {
  position: fixed;
  inset: 0;
  background: #faf9f2df;
  z-index: 100;
  display: grid;
  place-items: center;
}
#busy > div {
  text-align: center;
  font-size: 14px;
}
.spinner {
  display: inline-block;
  width: 34px;
  height: 34px;
  border: 3px solid #eadbd6;
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
[hidden] {
  display: none !important;
}
/* CELULAR: uma área por vez, botões de toque e rolagem normal fora da arte. */
@media (min-width: 1600px) {
  main {
    max-width: 1540px;
    margin: auto;
  }
  .workspace {
    grid-template-columns: minmax(300px, 1fr) 300px;
  }
  .artboard-host {
    width: 390px;
  }
}
@media (max-width: 1120px) {
  .topbar {
    padding: 0 24px;
  }
  .studio-badge {
    display: none;
  }
  .welcome {
    padding: 29px 24px;
  }
  .projectbar {
    margin-left: 24px;
    margin-right: 24px;
  }
  .workspace {
    margin: 0 24px;
    grid-template-columns: minmax(240px, 1fr) 245px;
  }
  .panel {
    padding: 18px 14px;
  }
  .template-image {
    height: 46px;
    width: 46px;
  }
  .template-card {
    padding: 6px;
    gap: 7px;
  }
  .template-card small {
    font-size: 8px;
  }
  .canvas-toolbar {
    padding: 0 8px;
  }
  .tool-button {
    padding: 4px;
  }
  .tool-button.labeled > span:last-child {
    display: none;
  }
  .canvas-area {
    padding: 22px 18px;
  }
  .welcome-note {
    display: none;
  }
  h1 {
    font-size: 30px;
  }
}
@media (max-width: 800px) {
  .topbar {
    height: 75px;
    padding: 0 17px;
    gap: 12px;
  }
  .header-actions {
    gap: 7px;
  }
  .button {
    padding: 10px 12px;
    font-size: 11px;
  }
  .header-actions .quiet {
    display: none;
  }
  .welcome {
    padding: 24px 20px 21px;
  }
  h1 {
    font-size: 29px;
    max-width: 320px;
    line-height: 1.17;
  }
  .welcome .eyebrow {
    font-size: 8px;
  }
  .welcome p {
    font-size: 11px;
    max-width: 285px;
    line-height: 1.7;
  }
  .projectbar {
    margin: 0 17px 12px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .project-title input {
    width: 178px;
    font-size: 13px;
  }
  .projectbar #save-status {
    display: none;
  }
  .projectbar .link-button {
    margin-left: auto;
  }
  .mobile-tabs {
    display: flex;
    margin: 0 17px;
    border: 1px solid var(--line);
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    background: #fffdf9;
  }
  .mobile-tabs button {
    flex: 1;
    font-size: 12px;
    min-height: 43px;
    color: var(--muted);
  }
  .mobile-tabs button.active {
    background: #f9e5e3;
    color: #a04e59;
    font-weight: 600;
  }
  .workspace {
    display: block;
    margin: 0 17px;
    min-height: 0;
    border-radius: 0 0 12px 12px;
  }
  .workspace[data-mobile-tab="canvas"] > .library,
  .workspace[data-mobile-tab="canvas"] > .settings,
  .workspace[data-mobile-tab="library"] > .canvas-panel,
  .workspace[data-mobile-tab="library"] > .settings,
  .workspace[data-mobile-tab="settings"] > .library,
  .workspace[data-mobile-tab="settings"] > .canvas-panel {
    display: none;
  }
  .panel {
    padding: 22px;
    border: 0;
  }
  .settings {
    max-height: none;
  }
  .template-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .template-card {
    flex-direction: column;
    text-align: center;
    padding: 12px;
  }
  .template-image {
    height: 90px;
    width: 90px;
  }
  .template-card i {
    display: none;
  }
  .template-card b {
    font-size: 12px;
  }
  .template-card small {
    font-size: 9px;
  }
  .template-card > span {
    gap: 6px;
  }
  .library-note {
    margin-top: 18px;
  }
  .canvas-toolbar {
    height: 53px;
    padding: 0 12px;
  }
  .tool-button {
    min-height: 40px;
    min-width: 34px;
  }
  .tool-button.labeled > span:last-child {
    display: none;
  }
  .canvas-area {
    min-height: 355px;
    padding: 23px 25px;
  }
  .artboard-host {
    width: 270px;
  }
  .art-label {
    margin-bottom: 17px;
    font-size: 7px;
  }
  .canvas-tip {
    font-size: 9px;
    margin-top: 18px;
  }
  .canvas-bottom {
    padding: 10px 11px;
    font-size: 9px;
    gap: 5px;
  }
  .canvas-bottom .link-button {
    font-size: 9px;
  }
  .pagebar {
    padding: 8px 10px;
  }
  .pagebar #page-count {
    white-space: nowrap;
    font-size: 8px;
  }
  .settings .field {
    font-size: 12px;
  }
  .settings .field input:not([type="color"]),
  .settings .field textarea,
  .settings .field select {
    font-size: 16px;
    min-height: 44px;
  }
  .field input[type="color"] {
    height: 44px;
  }
  .mini-actions button,
  .mini-actions a {
    min-height: 41px;
    padding: 9px 12px;
    font-size: 12px;
  }
  .check-row {
    font-size: 12px;
    min-height: 36px;
  }
  footer {
    padding: 20px 20px 24px;
    font-size: 8px;
    gap: 15px;
  }
  footer > span:last-child {
    font-size: 11px;
    white-space: nowrap;
  }
  dialog {
    padding: 23px;
  }
  dialog .button {
    min-height: 48px;
    font-size: 13px;
  }
  #busy > div {
    padding: 20px;
  }
  #toast {
    bottom: 18px;
    width: calc(100% - 40px);
    text-align: center;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
