:root { --accent: #2f5d50; --ink: #1f2421; --muted: #6b716d; --line: #e3e5e1; --bg: transparent; --card: #fff; --radius: 10px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.ps-app { max-width: 760px; margin: 0 auto; padding: 20px 16px 28px; }
h2 { font-size: 1.5rem; margin: 0 0 6px; }
h3 { font-size: 1.05rem; margin: 26px 0 10px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.notice { background: #eef5f2; border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.ps-error { color: #a32020; background: #fdeeee; padding: 8px 12px; border-radius: 6px; }
.ps-error[hidden] { display: none; }

.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 11px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: filter .15s; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: default; filter: none; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.sm { padding: 6px 12px; font-size: .9rem; }
.btn.block { width: 100%; }
.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.back { margin-bottom: 12px; text-decoration: none; }

.pkgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 16px 0; }
.pkg { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.pkg-body { padding: 16px 16px 8px; flex: 1; }
.pkg h3 { margin: 0 0 4px; }
.pkg .desc { font-size: .92rem; margin: 10px 0 0; }
.pkg-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); }
.price { font-weight: 700; font-size: 1.15rem; }

.week-nav { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 10px; }
.days { display: flex; flex-direction: column; gap: 10px; min-height: 80px; }
.day { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.day-label { font-weight: 600; padding-top: 6px; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { background: var(--card); border: 1.5px solid var(--accent); color: var(--accent); border-radius: 8px; padding: 7px 12px; font: inherit; font-weight: 600; cursor: pointer; min-width: 84px; }
.slot:hover, .slot:focus { background: var(--accent); color: #fff; }

.summary { display: grid; grid-template-columns: 1fr auto; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0 18px; }
.summary .full { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 8px; }
.summary .right { text-align: right; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .93rem; }
.form input, .form textarea { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid #cfd3cf; border-radius: 8px; background: #fff; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card.narrow { max-width: 440px; margin: 10px auto; }
.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.head-row { display: flex; justify-content: space-between; align-items: baseline; }

@media (max-width: 520px) {
  .day { grid-template-columns: 1fr; gap: 6px; }
  .day-label { padding-top: 0; }
  .row { flex-direction: column; align-items: flex-start; }
}

.sigpad { width: 100%; height: 160px; border: 1.5px dashed #b9beb9; border-radius: 8px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.sig-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; flex-wrap: wrap; }
.sig-head .link { margin-left: auto; }
.agreement-doc h3 { margin: 22px 0 6px; font-size: 1.05rem; }
.agreement-doc p, .agreement-doc li { font-size: .97rem; }
.notice.warn { background: #fff6e5; border-left-color: #d08a00; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pdf-viewer { background: #e9ebe8; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 10px; max-height: 75vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pdf-page { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); position: relative; }
.pdf-page canvas { display: block; }
.pdf-page-no { position: absolute; right: 8px; bottom: 6px; font-size: .72rem; color: #888; background: rgba(255,255,255,.85); padding: 1px 6px; border-radius: 4px; }
.checks { list-style: none; padding: 0; margin: 10px 0 0; }
.checks li { padding: 2px 0; }
.checks .ok { color: #1d6b3c; }
.checks .bad { color: #a32020; font-weight: 600; }
.repeat { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; margin: 0; background: #fff; }
.repeat legend { font-weight: 600; font-size: .93rem; padding: 0 4px; }
.series { list-style: none; padding: 0; margin: 4px 0; }
.series li { padding: 3px 0; }
.series li.ok { color: #1d6b3c; }
.series li.no { color: #a32020; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.form select { font: inherit; font-weight: 400; padding: 9px 10px; border: 1px solid #cfd3cf; border-radius: 8px; background: #fff; }
.summary .full:first-child { border-top: 0; padding-top: 0; }

[hidden] { display: none !important; }

/* Checkout → signing progress */
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; font-size: .9rem; font-weight: 600; }
.steps span { padding: 6px 12px; border-radius: 999px; background: #ecece7; color: #666; }
.steps .done { background: #e3f1ea; color: #23704a; }
.steps .cur { background: var(--accent, #2f5d50); color: #fff; }

/* Portal: book more */
.card.more { margin-top: 18px; }
.card.more h3 { margin-top: 0; }
input[readonly] { background: #f3f3f0; color: #555; }

/* Jump to next available */
.jump { margin: -4px 0 8px; font-size: .9rem; }
.slot.next { background: var(--accent); color: #fff; outline: 2px solid var(--accent); outline-offset: 2px; animation: psPulse 1.2s ease-in-out 3; }
@keyframes psPulse { 50% { outline-offset: 5px; } }
