/* SQ3R template — worksheet on the shared MacPlus chrome */

.sq-page .header-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 6px 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.sq-page .header-back-link:hover {
  border-color: var(--text-secondary);
  text-decoration: none;
}

.sq-page .page-intro {
  max-width: 42rem;
}

.sq-page .lead {
  margin: 0 0 0.75rem;
  color: var(--text-secondary);
  font-size: 1.0625rem;
}

.sq-page .privacy-line {
  margin: 0;
}

.sq-tool {
  max-width: 860px;
  margin: 0 auto 1.25rem;
}

.mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  align-items: flex-end;
  margin-bottom: 0.85rem;
}

.choices {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.choices legend {
  padding: 0;
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.choice:has(input:checked) {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.choice input {
  margin: 0;
  accent-color: currentColor;
}

.sheet {
  position: relative;
  color-scheme: light;
  background: #fffcf7;
  color: #1d1d1f;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.sheet::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: #243044;
}

.sheet-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9.5rem, auto);
  gap: 0.35rem 1rem;
  padding: 1rem 1.1rem 0.9rem 1.45rem;
  border-bottom: 1px solid #8aa0b8;
}

.field-source {
  grid-column: 1 / -1;
}

.method-stamp {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #314152;
}

.sheet label {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #314152;
}

.sheet input,
.sheet textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0.15rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1d1d1f;
  font: inherit;
  line-height: 1.4;
}

.sheet input {
  padding: 6px 8px;
}

.sheet input[type='text'] {
  border-bottom: 1px solid #d5dde6;
}

.field-title input {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.sheet input:focus,
.sheet textarea:focus,
.choice:focus-within {
  outline: 2px solid #005bb5;
  outline-offset: 2px;
}

.sheet input:focus,
.sheet textarea:focus {
  outline-offset: -4px;
}

.sheet input::placeholder,
.sheet textarea::placeholder {
  color: #4d5d6e;
}

.steps {
  display: flex;
  flex-direction: column;
}

.step {
  display: grid;
  grid-template-columns: 7.25rem minmax(0, 1fr);
  gap: 0.35rem 0.75rem;
  padding: 0.8rem 1rem 0.9rem 1.45rem;
  border-top: 1px solid #d5dde6;
}

.step[hidden],
.choices[hidden] {
  display: none !important;
}

.step:first-child {
  border-top: 0;
}

.step-label {
  padding-top: 0.15rem;
}

.step-num {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #314152;
}

.step-label label {
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

.step-hint {
  margin: 0 0 0.35rem;
  color: #314152;
  font-size: 0.875rem;
  line-height: 1.45;
}

.step textarea {
  min-height: 6.5rem;
  resize: vertical;
  line-height: 28px;
  padding: 4px 0 0.5rem;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 27px,
    #d5dde6 27px,
    #d5dde6 28px
  );
  background-position: 0 2px;
  background-attachment: local;
}

.headings-box {
  margin-bottom: 0.7rem;
  padding: 0.6rem 0.7rem 0.7rem;
  border: 1px solid #d5dde6;
  border-radius: 8px;
  background: #f4f7fb;
}

.headings-box textarea {
  min-height: 4.75rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #d5dde6;
  border-radius: 6px;
  background: #fff;
  background-image: none;
  line-height: 1.45;
}

.headings-box button {
  margin-top: 0.5rem;
}

.downloads,
.seo,
.faq,
.apps {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem 1.15rem;
  margin: 0 0 1rem;
}

.downloads h2,
.seo h2,
.faq h2,
.apps h2,
.cta h2 {
  margin: 0 0 0.4rem;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.downloads h3 {
  margin: 0.9rem 0 0.45rem;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.downloads p,
.seo p,
.apps p,
.faq p,
.cta p {
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

.dl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sq-tool button {
  font: inherit;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  min-height: 40px;
  max-width: 100%;
  white-space: normal;
  cursor: pointer;
}

.headings-box button {
  color: #1d1d1f;
  background: #fffcf7;
  border-color: #8aa0b8;
}

.sq-tool button:hover {
  border-color: var(--text-secondary);
}

.sq-tool button.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.save-status {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.seo h3,
.faq h3 {
  margin: 1.25rem 0 0.35rem;
  font-size: 1rem;
}

.seo ol,
.seo ul,
.apps ul {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}

.seo li,
.apps li {
  margin: 0.35rem 0;
  line-height: 1.5;
}

.faq details {
  border-top: 1px solid var(--border);
  padding: 0.7rem 0;
}

.faq details:last-of-type {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
}

.faq details p {
  margin: 0.45rem 0 0.2rem;
}

.cta {
  background: #243044;
  color: #f7f4ec;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.3rem 1.35rem;
  margin: 0 0 1rem;
}

.cta h2 {
  color: #fff;
  font-size: 1.35rem;
}

.cta p {
  max-width: 40rem;
  color: #e6edf4;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: #fffcf7;
  color: #1d1d1f;
  font-weight: 700;
  text-decoration: none;
}

.cta-link:hover {
  background: #fff;
  text-decoration: none;
}

.cta-link:focus-visible {
  outline: 2px solid #fffcf7;
  outline-offset: 3px;
}

.app-links {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 0.5rem;
}

.app-links li {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.app-links a {
  font-weight: 650;
}

.app-links span {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.app-feature {
  border-color: var(--text);
}

.sq-nav {
  margin: 0.25rem 0 0;
}

@media (max-width: 700px) {
  .sheet-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-source {
    grid-column: 1;
  }

  .step {
    grid-template-columns: minmax(0, 1fr);
    padding-right: 0.85rem;
  }

  .step textarea {
    min-height: 7.5rem;
  }

  .dl-row button {
    flex: 1 1 100%;
  }
}

@media print {
  body::before,
  .site-header,
  .site-footer,
  .page-intro,
  .mode-bar,
  .downloads,
  .seo,
  .faq,
  .cta,
  .apps,
  .save-status,
  .skip-link,
  .headings-box,
  .no-print {
    display: none !important;
  }

  body,
  main {
    margin: 0;
    padding: 0;
    max-width: none;
    background: #fff;
  }

  .sq-tool {
    max-width: none;
    margin: 0;
  }

  .sheet {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sheet::before {
    display: none;
  }

  .step {
    break-inside: avoid;
    grid-template-columns: 7.25rem minmax(0, 1fr);
  }

  .step textarea {
    min-height: 0 !important;
    resize: none;
  }

  .sheet,
  .sheet textarea,
  .sheet input {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

@page {
  size: A4;
  margin: 12mm;
}
