/* Free card maker (#83). */
.card-page .reset-main > .panel { margin-block: 0 1.5rem; }
.card-studio { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 900px) { .card-studio { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.card-preview { position: sticky; top: 1rem; display: grid; justify-items: center; gap: .75rem; }
.card-preview canvas { width: 100%; max-width: 26rem; height: auto; aspect-ratio: 5 / 7; border-radius: 14px; box-shadow: 0 18px 50px rgba(23,32,51,.22); background: #eee; }
@media (max-width: 899px) { .card-preview { position: static; } .card-preview canvas { max-width: 20rem; } }
.card-controls { display: grid; gap: 1.25rem; min-width: 0; }
.card-step { border: 0; margin: 0; padding: 0; display: grid; gap: .6rem; min-width: 0; }
.card-step legend { font-weight: 700; font-size: 1.05rem; padding: 0; margin-bottom: .4rem; }
.card-step label { display: grid; gap: .3rem; font-weight: 600; font-size: .95rem; }
.card-step input[type="text"], .card-step textarea { width: 100%; border: 1px solid rgba(23,32,51,.18); border-radius: 12px; padding: .7rem .8rem; background: #fff; color: var(--ink); }
.card-step textarea { resize: vertical; min-height: 5.5rem; }
.card-step .card-hint { font-weight: 400; color: var(--muted); font-size: .88rem; }
.card-names { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; }
.card-designs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.card-design { position: relative; display: grid; gap: .35rem; justify-items: center; cursor: pointer; font-weight: 600; font-size: .85rem; text-align: center; }
.card-design input { position: absolute; opacity: 0; pointer-events: none; }
.card-design-swatch { width: 100%; aspect-ratio: 5 / 4; border-radius: 10px; background: linear-gradient(180deg, var(--top), var(--bottom)); box-shadow: inset 0 0 0 1px rgba(23,32,51,.12); position: relative; }
.card-design-swatch::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22%; height: 6%; transform: translate(-50%, -50%); background: var(--accent); border-radius: 4px; }
.card-design input:checked + .card-design-swatch { box-shadow: 0 0 0 3px var(--ink); }
.card-design input:focus-visible + .card-design-swatch { outline: 3px solid var(--accent, #ff8a4c); outline-offset: 3px; }
.card-line-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.card-actions { display: flex; flex-wrap: wrap; gap: .6rem; position: relative; }
.card-actions .button, .card-line-row .button { text-decoration: none; display: inline-flex; align-items: center; border-radius: 999px; padding: .7rem 1.1rem; font-weight: 700; border: 1px solid rgba(23,32,51,.2); background: #fff; color: var(--ink); cursor: pointer; }
.card-actions .button-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.card-share-menu { position: absolute; top: calc(100% + .5rem); left: 0; z-index: 5; display: grid; gap: .25rem; min-width: 14rem; padding: .5rem; border-radius: 14px; background: #fff; box-shadow: 0 18px 50px rgba(23,32,51,.2); }
.card-share-menu[hidden] { display: none; }
.card-share-menu a, .card-share-menu button { display: block; text-align: left; padding: .6rem .75rem; border-radius: 10px; border: 0; background: none; color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer; }
.card-share-menu a:hover, .card-share-menu button:hover, .card-share-menu a:focus-visible, .card-share-menu button:focus-visible { background: rgba(23,32,51,.06); }
.card-status { min-height: 1.4em; color: var(--muted); margin: 0; }
.card-private { color: var(--muted); font-size: .9rem; margin: 0; }
.card-messages { display: grid; gap: 1rem; }
@media (min-width: 760px) { .card-messages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card-message-group h3 { margin: 0 0 .6rem; }
.card-message-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.card-message-group li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .7rem .85rem; border-radius: 12px; background: #fff; border: 1px solid rgba(23,32,51,.08); }
.card-message-group li span { min-width: 0; }
.card-message-group button { flex: none; border-radius: 999px; border: 1px solid rgba(23,32,51,.2); background: none; padding: .35rem .7rem; font-weight: 600; font-size: .85rem; cursor: pointer; color: var(--ink); }
.card-steps-list { margin: 0; padding-left: 1.2rem; display: grid; gap: .4rem; }
.card-view { display: grid; gap: 1.25rem; justify-items: center; text-align: center; }
.card-view canvas { width: 100%; max-width: 26rem; height: auto; aspect-ratio: 5 / 7; border-radius: 14px; box-shadow: 0 18px 50px rgba(23,32,51,.22); }
.card-inside { max-width: 32rem; padding: 1.25rem 1.5rem; border-radius: 14px; background: #fff; border: 1px solid rgba(23,32,51,.08); font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; line-height: 1.6; white-space: pre-line; }
.card-inside[hidden] { display: none; }
.card-view-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.card-view-actions a { border-radius: 999px; padding: .75rem 1.2rem; font-weight: 700; text-decoration: none; border: 1px solid rgba(23,32,51,.2); color: var(--ink); background: #fff; }
.card-view-actions a.button-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
#card-print-sheet { display: none; }
/* One sheet, printed on one side, folded twice into a card: the top row prints upside
   down so the front and back come out the right way up after folding. */
@media print {
  @page { size: portrait; margin: 0; }
  body > *:not(#card-print-sheet) { display: none !important; }
  body { background: #fff !important; }
  #card-print-sheet { display: grid !important; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; width: 100vw; height: 100vh; }
  .card-print-panel { display: grid; place-items: center; padding: 6%; overflow: hidden; }
  .card-print-front, .card-print-back { transform: rotate(180deg); }
  .card-print-front img { max-height: 46vh; max-width: 100%; }
  .card-print-back p { font: 600 9pt Inter, system-ui, sans-serif; color: #777; }
  .card-print-inside { align-content: center; justify-items: center; gap: .8rem; text-align: center; font-family: Georgia, "Times New Roman", serif; font-size: 14pt; line-height: 1.5; color: #222; white-space: pre-line; }
}
