/* ==========================================================================
   青云洲 CyanArk · Service Appointment & Scope Confirmation Stylesheet
   Bespoke Editorial Atelier Theme · Strict CSP Compliant
   ========================================================================== */

:root {
  color-scheme: light;
  --paper: #f3efe6;
  --sheet: #fbf9f4;
  --sheet-elevated: #ffffff;
  --ink: #142220;
  --ink-soft: #263835;
  --muted: #52635e;
  --rule: #c8cfc6;
  --rule-strong: #9aa69c;
  --teal: #0f5e54;
  --teal-tint: #e3ede9;
  --red: #9e3b24;
  --red-tint: #f9ebe6;
  --gold: #8c6722;
  --gold-tint: #f8f0dc;
  --soft: #e6ebe2;
  --navy: #142220;
  --mint: #d7e8d4;
  --line: #c8cfc6;
  --body-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --heading-font: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", SimSun, Georgia, serif;
  --mono-font: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-family: var(--body-font);
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: var(--body-font);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 0%, rgba(15, 94, 84, 0.06), transparent 36%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 4px;
}

a:hover {
  color: var(--red);
}

button, input, select {
  font: inherit;
  font-family: var(--body-font);
  touch-action: manipulation;
}

button {
  cursor: pointer;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  padding: 10px 18px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s ease;
}

button:hover:not(:disabled) {
  background: var(--soft);
}

button.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
  font-weight: 650;
}

button.primary:hover:not(:disabled) {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.brandbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font-family: var(--heading-font);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  text-decoration: none;
}

.mark {
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--sheet);
  width: 38px;
  height: 40px;
  border-radius: 4px;
  font-family: var(--heading-font);
  font-size: 19px;
  box-shadow: 3px 3px 0 var(--teal);
}

.brand small {
  display: block;
  font-family: var(--body-font);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 6px;
}

.brand-note {
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--teal);
  font-weight: 600;
  letter-spacing: 0.06em;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 40px 48px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.kicker {
  font-family: var(--mono-font);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--red);
  font-weight: 700;
  margin-bottom: 8px;
}

h1 {
  font-family: var(--heading-font);
  font-size: clamp(28px, 3.5vw, 38px);
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin: 0 0 10px;
}

h2 {
  font-family: var(--heading-font);
  font-size: 22px;
  line-height: 1.45;
  margin: 0 0 8px;
}

h3 {
  font-size: 17px;
  line-height: 1.5;
  margin: 0 0 9px;
}

p {
  margin: 0 0 12px;
  color: var(--muted);
}

nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
}

nav a {
  padding: 9px 16px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--sheet);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

nav a:hover {
  background: var(--soft);
}

.service-note {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--teal);
  background: var(--sheet);
  padding: 18px 22px;
  border-radius: 6px;
  margin-bottom: 22px;
  box-shadow: 0 2px 8px rgba(20, 34, 32, 0.04);
}

.service-note strong {
  color: var(--teal);
  font-size: 15px;
  display: block;
  margin-bottom: 4px;
}

.service-note p {
  font-size: 13.5px;
  margin: 4px 0;
  color: var(--ink-soft);
}

.service-note small {
  font-size: 12px;
  color: var(--muted);
}

.reconcile {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

#notice {
  font-size: 13.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  padding: 12px 16px;
  background: var(--gold-tint);
  border: 1px solid #d6be86;
  border-left: 4px solid var(--gold);
  border-radius: 4px;
  color: #634812;
}

#notice:empty {
  display: none;
}

section {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ink);
  background: var(--sheet);
  border-radius: 6px;
  padding: 28px;
  margin-bottom: 24px;
  min-width: 0;
  box-shadow: 0 4px 16px rgba(20, 34, 32, 0.04);
}

.section-heading {
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}

.section-heading p, .help {
  font-size: 13px;
  color: var(--muted);
}

form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
  min-width: 0;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--rule-strong);
  background: var(--sheet-elevated);
  border-radius: 4px;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--ink);
}

input[type="checkbox"] {
  accent-color: var(--teal);
  width: 18px;
  height: 18px;
}

.wide {
  grid-column: 1 / -1;
}

.form-action {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.scope {
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--teal);
  border-radius: 4px;
}

.scope p, .scope li {
  font-size: 13.5px;
  white-space: pre-wrap;
  color: var(--ink-soft);
}

.scope ul {
  padding-left: 20px;
  margin: 6px 0 16px;
}

.scope summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  cursor: pointer;
}

.card {
  padding: 22px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--sheet-elevated);
  margin: 15px 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.status {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 3px 10px;
  background: var(--teal-tint);
  color: var(--teal);
  white-space: normal;
}

.status.requested {
  background: var(--gold-tint);
  border-color: #d6be86;
  color: var(--gold);
}

.status.cancelled, .status.expired {
  background: var(--soft);
  color: var(--muted);
}

.booking-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin: 14px 0;
}

.booking-meta p {
  font-size: 13px;
  margin: 0;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.actions select {
  width: 100%;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 22px;
  margin: 17px 0;
}

.detail-grid dt {
  font-size: 12px;
  color: var(--muted);
}

.detail-grid dd {
  margin: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.booking-detail:empty {
  display: none;
}

.booking-detail {
  margin-top: 26px;
  border-top: 1px solid var(--rule);
  padding-top: 26px;
  min-width: 0;
}

.booking-detail ul {
  padding-left: 20px;
}

.diagnostics {
  margin-top: 20px;
  border-top: 1px solid var(--rule);
  padding-top: 15px;
  font-size: 12px;
}

.diagnostics summary {
  color: var(--muted);
  cursor: pointer;
}

.pagination {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.section-subtitle {
  margin-top: 27px;
}

.window-card {
  border-left: 3px solid var(--teal);
  padding: 12px 16px;
  background: var(--paper);
  margin-bottom: 12px;
}

.window-card p {
  font-size: 13px;
  margin: 3px 0;
}

footer {
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  margin-top: 36px;
  line-height: 1.85;
}

.icp-registration {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
}

.skip {
  position: absolute;
  left: -10000px;
}

.skip:focus {
  left: 20px;
  top: 10px;
  background: var(--sheet-elevated);
  padding: 12px;
  z-index: 100;
}

h1, h2, h3, p, span, a, label, li, dt, dd, small {
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .brandbar {
    padding: 18px;
  }
  .brand {
    font-size: 20px;
  }
  .brand-note {
    font-size: 11px;
  }
  main {
    padding: 24px 18px;
  }
  .page-heading {
    display: block;
  }
  .page-heading nav {
    margin-top: 18px;
  }
  h1 {
    font-size: 27px;
  }
  h2 {
    font-size: 20px;
  }
  section {
    padding: 20px;
  }
  form, .booking-meta, .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .card {
    padding: 18px;
  }
  .card-heading {
    display: block;
  }
  .card-heading .status {
    margin-bottom: 8px;
  }
  .scope {
    padding: 16px;
  }
  .actions button {
    flex: 1 1 auto;
  }
  .service-note {
    padding: 15px 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
