* {
  box-sizing: border-box;
}
/* Tools live inside the authenticated company workspace. */
.studio-dialog {
  border: 0;
  border-radius: 22px;
  background: #f3f4ed;
  color: #182822;
  padding: 30px;
  max-width: 1120px;
  width: calc(100% - 48px);
  max-height: 94vh;
  overflow: auto;
  box-shadow: 0 35px 120px #0005;
}
.studio-dialog::backdrop {
  background: #08130eb8;
  backdrop-filter: blur(7px);
}
.studio-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid #d5ded1;
  margin-bottom: 28px;
}
.studio-head h2 {
  font-size: 30px;
  margin: 6px 0 0;
  letter-spacing: -1px;
}
.studio-head .eyebrow {
  font-size: 10px;
  color: #6b7d64;
  letter-spacing: 1.7px;
  margin: 0;
}
.phone-studio {
  display: grid;
  grid-template-columns: 1fr 392px;
  gap: 60px;
  align-items: center;
  padding: 0 45px 15px;
}
.studio-copy h3 {
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -1.6px;
}
.studio-copy p {
  font-size: 14px;
  line-height: 1.7;
  max-width: 380px;
}
.studio-copy .actions {
  gap: 8px;
}
.studio-copy button {
  font-size: 12px;
  padding: 10px 12px;
}
.device {
  width: 382px;
  height: 780px;
  border: 8px solid #17231d;
  border-radius: 48px;
  background: #17231d;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px #12221b30;
}
.device-camera {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 94px;
  height: 18px;
  border-radius: 20px;
  background: #17231d;
  z-index: 2;
}
.device iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 38px;
  background: #fff;
}
.qr-studio {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 60px;
  align-items: center;
  padding: 12px 30px;
}
.qr-controls p {
  max-width: 330px;
}
.qr-help {
  font-size: 12px;
  line-height: 1.6;
}
.print-card {
  width: 420px;
  aspect-ratio: 5/7;
  display: flex;
  flex-direction: column;
  border: 1px solid #dce2d9;
  padding: 28px 30px;
  color: #182822;
  background: #fff;
  box-shadow: 0 18px 40px #12221b16;
  border-top: 7px solid #c4dfb0;
}
.print-top,
.print-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8px;
  letter-spacing: 1px;
  gap: 14px;
}
.print-top {
  color: #6b806e;
}
.print-top span:last-child {
  font-size: 22px;
}
.print-brand {
  margin: 19px 0 16px;
  text-align: center;
}
.print-brand img {
  max-width: 190px;
  max-height: 35px;
  object-fit: contain;
}
.print-brand h3 {
  font-size: 27px;
  line-height: 1.1;
  margin: 12px 0 0;
  overflow-wrap: anywhere;
  letter-spacing: -1px;
}
.qr-paper {
  background: white;
  padding: 8px;
  align-self: center;
  border-radius: 12px;
}
.qr-paper img {
  display: block;
  width: 252px;
  height: 252px;
  image-rendering: pixelated;
}
.print-card > p {
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  margin: 20px auto;
  max-width: 300px;
  overflow-wrap: anywhere;
}
.print-bottom {
  border-top: 1px solid #dce2d9;
  margin-top: auto;
  padding-top: 19px;
  letter-spacing: 0;
  color: #657d68;
}
.print-bottom strong {
  font-size: 21px;
  letter-spacing: -1px;
  color: #182822;
}
.qr-dark {
  background: #14241e;
  border-color: #14241e;
  border-top-color: #d5fa64;
  color: white;
}
.qr-dark .print-top {
  color: #d5fa64;
}
.qr-dark > p,
.qr-dark .print-bottom {
  color: #bccbbf;
}
.qr-dark .print-bottom {
  border-color: #3c5143;
}
.qr-dark .print-bottom strong {
  color: #d5fa64;
}
.qr-minimal {
  border-top: 1px solid #dce2d9;
  box-shadow: none;
}
.qr-minimal .print-top {
  visibility: hidden;
}
.qr-minimal .qr-paper {
  padding: 0;
}
.qr-minimal .print-brand {
  margin-top: 4px;
}
#newKey {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.toolbar #companyName {
  margin: 5px 0;
  font-size: 26px;
}
body:has(#phoneDialog[open]),
body:has(#qrDialog[open]) {
  overflow: hidden;
}
@media (max-width: 850px) {
  .phone-studio,
  .qr-studio {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 24px;
  }
  .studio-copy h3 {
    font-size: 28px;
  }
  .device,
  .print-card {
    justify-self: center;
  }
  .studio-copy p {
    max-width: none;
  }
  .device {
    max-width: 100%;
    height: 740px;
  }
  .print-card {
    max-width: 100%;
  }
  .studio-dialog {
    padding: 20px;
    width: calc(100% - 20px);
  }
  .studio-head h2 {
    font-size: 24px;
  }
  .qr-paper img {
    max-width: 100%;
  }
}
@media print {
  @page {
    size: A6 portrait;
    margin: 7mm;
  }
  body > * {
    display: none !important;
  }
  body > #qrDialog {
    display: block !important;
    position: static;
    width: 100%;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    overflow: visible;
    box-shadow: none;
    background: white;
  }
  #qrDialog::backdrop {
    display: none;
  }
  #qrDialog .studio-head,
  #qrDialog .qr-controls {
    display: none !important;
  }
  #qrDialog .qr-studio {
    display: block;
    padding: 0;
  }
  #qrDialog .print-card {
    width: 100%;
    height: 132mm;
    aspect-ratio: auto;
    box-shadow: none;
    break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 6mm;
  }
  #qrDialog .qr-paper img {
    width: 61mm;
    height: 61mm;
  }
  #qrDialog .print-brand h3 {
    font-size: 20px;
  }
  #qrDialog .print-top {
    font-size: 6px;
  }
  #qrDialog .print-brand {
    margin: 12px 0;
  }
  #qrDialog .print-brand img {
    max-width: 140px;
    max-height: 28px;
  }
  #qrDialog .print-card > p {
    font-size: 10px;
    margin: 10px 0;
  }
  #qrDialog .print-bottom {
    font-size: 7px;
    padding-top: 10px;
  }
}
body {
  margin: 0;
  background: #f3f4ed;
  color: #122b25;
  font:
    16px/1.5 system-ui,
    -apple-system,
    sans-serif;
}
header {
  padding: 22px max(24px, calc((100vw - 1400px) / 2));
  display: flex;
  gap: 24px;
  align-items: center;
  background: #111c1a;
  color: #fff;
  min-height: 85px;
}
.brandmark {
  font-weight: 850;
  font-size: 25px;
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.brandmark span {
  font-weight: 400;
  font-size: 15px;
  margin-left: 12px;
  opacity: 0.7;
}
#sessionLabel {
  margin-left: auto;
  font-size: 14px;
}
main {
  max-width: 1400px;
  margin: auto;
  padding: 32px 28px 80px;
}
h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin: 12px 0 20px;
}
h2 {
  font-size: 24px;
  line-height: 1.2;
  margin: 8px 0 20px;
}
p {
  color: #62736a;
}
button,
a,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  background: #203a2b;
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 12px 20px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover {
  filter: brightness(0.94);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: #18694f;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid #ccd3ca;
  border-radius: 8px;
  background: white;
  color: #122b25;
  font-weight: 400;
}
textarea {
  resize: vertical;
}
input[type="color"] {
  height: 48px;
}
label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin: 15px 0;
}
fieldset {
  border: 1px solid #d9ded4;
  border-radius: 10px;
  padding: 16px;
  margin: 24px 0;
}
legend {
  font-weight: 700;
}
small {
  display: block;
  color: #62736a;
  margin-top: 12px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check input {
  width: 18px;
  height: 18px;
  margin: 0;
}
.quiet {
  color: #163b2c;
  background: #e7ece2;
}
.danger {
  background: #f8e7df;
  color: #a02b21;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: #5d7844;
}
.login {
  max-width: 600px;
  margin: 70px auto;
}
.login h1 {
  font-size: 64px;
}
.login form {
  margin-top: 32px;
}
.toolbar,
.sectionHeading,
.actions,
.formRow {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.toolbar > div:first-child {
  flex: 1;
  max-width: 480px;
}
.toolbar p {
  margin: 0;
}
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #d5dccf;
  margin: 32px 0;
}
.tabs button {
  background: none;
  color: #637469;
  border-radius: 0;
  padding: 16px 20px;
}
.tabs button.selected {
  color: #122b25;
  border-bottom: 3px solid #94b959;
}
.sectionHeading {
  justify-content: space-between;
  align-items: start;
}
.sectionHeading p {
  margin-top: -7px;
}
.editorLayout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 1.1fr);
  gap: 30px;
  align-items: start;
}
.editorLayout:has(#articleForm[hidden]) {
  grid-template-columns: 1fr;
}
.editor {
  background: #fff;
  padding: 26px;
  border: 1px solid #dfe3d9;
  border-radius: 14px;
}
#brandForm {
  max-width: 850px;
}
.formRow > label {
  flex: 1;
  min-width: 170px;
}
.articleList {
  display: grid;
  gap: 14px;
}
.newsRow {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 16px;
  background: white;
  border: 1px solid #dfe3d9;
  border-radius: 12px;
}
.newsRow img {
  width: 140px;
  height: 100px;
  object-fit: cover;
  border-radius: 7px;
  background: #e7ece2;
}
.newsRow h3 {
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.2;
  margin: 0 0 9px;
}
.newsRow p {
  overflow-wrap: anywhere;
  font-size: 14px;
  margin: 4px 0;
}
.newsRow button {
  padding: 7px 12px;
  font-size: 14px;
  margin-top: 7px;
}
#message {
  padding: 0;
  margin: 0 0 15px;
  color: #a02b21;
  white-space: pre-line;
}
#message:empty {
  display: none;
}
.demo {
  background: #fff0d8;
  border-left: 3px solid #d56632;
  padding: 12px 16px;
  color: #7d4b13;
}
#photoPreview {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  background: #f0f3ed;
}
.textCounter {
  display: block;
  text-align: right;
  color: #536156;
  font-size: 12px;
  font-weight: normal;
  margin-top: 5px;
}
.paymentEntry {
  border-top: 1px solid #dfe3d9;
  padding: 16px 0;
  overflow-wrap: anywhere;
}
#paymentForm,
#billingAccessForm {
  margin-bottom: 28px;
}
#logoPreview {
  max-width: 250px;
  max-height: 100px;
}
.linkRow {
  display: grid;
  grid-template-columns: 1fr 1.5fr auto;
  gap: 8px;
  margin: 10px 0;
}
.linkRow input {
  min-width: 0;
}
.linkRow button {
  padding: 8px 12px;
}
#newKey {
  display: block;
  overflow-wrap: anywhere;
  font-family: monospace;
  margin-top: 16px;
}
footer {
  padding: 24px;
  text-align: center;
  color: #637469;
  font-size: 13px;
}
#more {
  margin-top: 20px;
}
.preview {
  margin-top: 25px;
  border-top: 1px solid #ddd;
  padding-top: 25px;
  white-space: pre-wrap;
}
.preview img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}
.preview a {
  display: block;
  margin: 12px 0;
}
[hidden] {
  display: none !important;
}
/* Touch-first editing: avoid keyboard zoom and side-scrolling on phones. */
button,
input,
select {
  min-height: 44px;
}
input,
textarea,
select {
  font-size: 16px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #749a59;
  outline-offset: 3px;
}
.qr-paper {
  max-width: 100%;
}
.qr-paper img {
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
}
.print-card {
  overflow: hidden;
}
.print-brand h3 {
  max-height: 3.3em;
  overflow: hidden;
}
.editorLayout > *,
.toolbar > * {
  min-width: 0;
}
#invitationPanel {
  max-width: 850px;
  background: #eef3e6;
  padding: 24px;
  border: 1px solid #dce5d2;
  border-radius: 14px;
  white-space: normal;
}
#invitationQR {
  max-width: 180px;
  height: auto;
  object-fit: contain;
}
#invitationLink {
  overflow-wrap: anywhere;
}
#brandPanel > p {
  max-width: 650px;
}
.studio-dialog button {
  min-height: 44px;
}
@media (max-width: 600px) {
  header {
    flex-wrap: wrap;
  }
  header #sessionLabel {
    font-size: 11px;
  }
  main {
    padding-bottom: 40px !important;
  }
  .toolbar {
    gap: 10px;
  }
  .toolbar > div:first-child {
    flex: 1 1 100%;
  }
  .toolbar #phoneMode,
  .toolbar #qrMode {
    flex: 1;
    font-size: 13px;
    padding: 10px;
  }
  .toolbar #publicLink {
    font-size: 13px;
  }
  .toolbar #addBrand {
    font-size: 13px;
    padding: 10px;
  }
  .tabs {
    margin: 20px 0;
  }
  .tabs button {
    padding: 12px 14px;
    font-size: 14px;
  }
  .newsRow {
    grid-template-columns: 84px minmax(0, 1fr);
    padding: 12px;
    gap: 12px;
  }
  .newsRow img {
    width: 84px;
    height: 90px;
  }
  .newsRow h3 {
    font-size: 17px;
    overflow-wrap: anywhere;
  }
  .newsRow p {
    font-size: 12px;
  }
  .editor .actions {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 12px 0;
    margin-top: 12px;
    border-top: 1px solid #e1e6dd;
    z-index: 1;
    gap: 8px;
  }
  .editor .actions button {
    flex: 1;
    font-size: 13px;
    padding: 12px 10px;
  }
  .editor .formRow {
    gap: 0;
  }
  .editor .formRow > label {
    flex-basis: 100%;
  }
  .studio-head {
    gap: 10px;
  }
  .studio-head h2 {
    font-size: 21px;
  }
  .studio-head button {
    padding: 10px;
    font-size: 12px;
  }
  .phone-studio .studio-copy h3 {
    display: none;
  }
  .phone-studio .studio-copy p {
    font-size: 12px;
    margin: 0 0 12px;
  }
  .phone-studio .device {
    height: min(740px, 75vh);
  }
  .qr-studio {
    display: flex;
    flex-direction: column;
  }
  .qr-controls {
    width: 100%;
  }
  .qr-controls > p {
    max-width: none;
  }
  .qr-controls label {
    margin: 12px 0;
  }
  .print-card {
    width: 100%;
    min-height: 520px;
  }
  .print-brand h3 {
    font-size: 23px;
  }
  .print-top {
    font-size: 7px;
  }
  .studio-dialog {
    max-height: 96vh;
  }
  .studio-head {
    margin-bottom: 18px;
    padding-bottom: 18px;
  }
}
@media (max-width: 900px) {
  .editorLayout {
    grid-template-columns: 1fr;
  }
  .login h1 {
    font-size: 48px;
  }
  main {
    padding: 20px 16px;
  }
  .newsRow {
    grid-template-columns: 105px 1fr;
  }
  .newsRow img {
    width: 105px;
    height: 100px;
  }
  .editor {
    padding: 18px;
  }
  .linkRow {
    grid-template-columns: 1fr;
  }
  .brandmark span {
    display: none;
  }
  header {
    padding: 18px 16px;
    gap: 10px;
  }
}
