/* Shared translucent frame; input stages keep the same illustration and typography. */
#input-screen.silk-grove[data-step="name"] {
  position: relative; isolation: isolate; display: grid; align-items: end;
  min-height: 100svh; background: #1b3027; color: #1c382b;
}
#input-screen.silk-grove[data-step="name"] .portrait {
  position: absolute; inset: 0; width: 100%; height: auto;
  background: linear-gradient(transparent 56%, rgb(8 29 22 / .21) 79%, rgb(11 38 25 / .48));
}
#input-screen.silk-grove[data-step="name"] .portrait img {
  height: calc(100% - 4rem); object-position: 85% 30%;
  mask-image: linear-gradient(#000 0 90%, transparent 100%);
}
#input-screen.silk-grove[data-step="name"] .voice {
  margin-top: clamp(250px, 55svh, 630px); padding: 0 .73rem max(1.9rem, env(safe-area-inset-bottom));
  background: transparent;
}
#input-screen.silk-grove[data-step="name"] .voice::before { content: none; }
.name-form-scene { position: relative; isolation: isolate; padding: min(65vw, 270px) .73rem 1rem; background: #1b3027; }
.name-form-scene > img { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 85% 30%; }
.name-panel{position:relative;isolation:isolate;width:100%;min-width:0;padding:5px;border:1px solid #4a4831;border-radius:3px 14px 3px 14px;box-shadow:0 10px 26px #0c211c66,0 1px 1px #101f0d}
.name-silk{position:relative;isolation:isolate;text-align:center;overflow-wrap:break-word;border:1px solid #56644f;border-radius:1px 9px 2px 9px;padding:1.15rem 1.05rem 1.05rem;background-color:rgb(217 231 205 / .77);backdrop-filter:blur(3px);background-image:linear-gradient(150deg,#f7f0ce68,#d5e3d53b 45%,#acbea925),repeating-linear-gradient(0deg,#4562490d 0 1px,transparent 1px 3px),repeating-linear-gradient(90deg,#eef0d126 0 1px,transparent 1px 3px);box-shadow:inset 0 0 0 1px #f4edc9,inset 0 0 13px #76947d38}
.name-silk:after{content:"";position:absolute;z-index:-1;pointer-events:none;inset:0;opacity:.27;background:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20600%20150%22%20preserveAspectRatio%3D%22none%22%3E%3Cg%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%3E%3Cg%20stroke%3D%22%23688877%22%20stroke-width%3D%221%22%3E%3Cpath%20d%3D%22M-8%20149q41-9%2065-24t48-31q14-12%2032-15%2017-3%2044-30%2014%2020%2031%2023t37%2028q17%209%2032%208m-296%2053q60-15%2099-39%2029-17%2050-24t50-40%2040%2025m385%2050q-44-12-67-42t-64-41q-12-6-19-22-14%2022-28%2026t-39%2030m214%2038q-48-10-75-37-24-23-48-27-14-4-24-17%22%2F%3E%3C%2Fg%3E%3Cpath%20fill%3D%22%2387a28d%22%20opacity%3D%22.16%22%20stroke%3D%22none%22%20d%3D%22M0%20150q34-20%2068-26t62-26q20-13%2039-36%2017%2027%2053%2037%2028%209%2056%2033l45%2018zm366%200q46-21%2067-45%2018-20%2045-26%2010-3%2015-15%208%2020%2037%2037%2026%2015%2070%2017v32z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center bottom/100% 55% no-repeat}
.name-hardware{position:absolute;inset:-2px;z-index:2;pointer-events:none}.name-hardware i{position:absolute;width:57px;height:51px;background:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2074%2066%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22b%22%20x1%3D%220%22%20x2%3D%22.76%22%20y2%3D%221%22%20gradientUnits%3D%22objectBoundingBox%22%3E%3Cstop%20stop-color%3D%22%23544524%22%2F%3E%3Cstop%20offset%3D%22.15%22%20stop-color%3D%22%23e9dbaa%22%2F%3E%3Cstop%20offset%3D%22.28%22%20stop-color%3D%22%23a2854c%22%2F%3E%3Cstop%20offset%3D%22.49%22%20stop-color%3D%22%23e4d5a3%22%2F%3E%3Cstop%20offset%3D%22.67%22%20stop-color%3D%22%23806944%22%2F%3E%3Cstop%20offset%3D%22.86%22%20stop-color%3D%22%23b29962%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23574d35%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22j%22%20x2%3D%22.9%22%20y2%3D%221%22%20gradientUnits%3D%22objectBoundingBox%22%3E%3Cstop%20stop-color%3D%22%23e1ead6%22%2F%3E%3Cstop%20offset%3D%22.46%22%20stop-color%3D%22%238eb39c%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23426752%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cg%20stroke%3D%22%23554a32%22%20stroke-width%3D%22.8%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20fill%3D%22url%28%23b%29%22%20d%3D%22M3%2048%203%2013Q3%206%2010%206h48l-7%205H16q-6%200-6%206v29l-4%208z%22%2F%3E%3Cpath%20fill%3D%22url%28%23j%29%22%20d%3D%22M6.1%2037V15Q6%208.7%2013%208.7h27l-3%201.7-20%20.4q-8%20.4-8.5%207.4L8%2034z%22%20stroke-width%3D%22.55%22%2F%3E%3Cpath%20fill%3D%22url%28%23b%29%22%20d%3D%22m4%2027%201-2%206%20.1%201%201.8-1.3%202.1-5.5.8zM27%205.4l1.8-1.3%202.6.7%201%206.8-1.3%201.2-2.6-.2z%22%2F%3E%3Cpath%20fill%3D%22url%28%23b%29%22%20d%3D%22M13%2017c1-3%208-6%2014-5.7-2.4%203-7.8%205.3-12.7%207.9%203.5-.1%207.8.5%2011.8%202.3-5.8%201.4-10.5.8-14-1.2l-1.1%204.8-2-1.1%201.2-5.9z%22%2F%3E%3Cpath%20fill%3D%22url%28%23j%29%22%20d%3D%22M16.6%2015.2q4-2.5%208.1-2.8-3.1%202-7.6%203.6zm-1%204.6q3.8%200%207.3%201-4%20.5-7.1%200z%22%20stroke%3D%22none%22%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%22none%22%20stroke-width%3D%22.7%22%3E%3Cpath%20stroke%3D%22%23f5ead0%22%20d%3D%22M4.3%2022v-9q.2-5.6%207-5.8h14m8.5%200h16M5%2027.1l5-.4m19-20%20.9%204.4%22%2F%3E%3Cpath%20stroke%3D%22%23c7b386%22%20d%3D%22M12.2%2028v12l-2.2%206%20M38%2013.2h10l8-3%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") top left/contain no-repeat}
.name-hardware:before{content:"";position:absolute;inset:2px;padding:5px;border-radius:2px 13px 3px 13px;background:linear-gradient(135deg,#514a31 0%,#dbcf9d 2%,#796748 5%,#bcae7d 17%,#766847 35%,#ccc799 61%,#706a47 83%,#dacf9c 96%,#62583c);mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);mask-composite:exclude}
.name-hardware i:first-child{top:0;left:0}.name-hardware i:nth-child(2){top:0;right:0;transform:scaleX(-1)}.name-hardware i:nth-child(3){bottom:0;left:0;transform:scaleY(-1)}.name-hardware i:nth-child(4){bottom:0;right:0;transform:scale(-1)}
.name-panel:before,.name-panel:after{content:"";position:absolute;left:50%;z-index:3;pointer-events:none}
.name-panel:before{top:-4px;width:24px;height:7px;transform:translateX(-50%);border:1px solid #75694a;border-radius:60% 60% 45% 45%;background:linear-gradient(#e1d7ac,#b7c6a3 40%,#82a391 75%,#aa9770)}
.name-panel:after{bottom:1px;width:45px;height:1px;transform:translateX(-50%);background:linear-gradient(90deg,transparent,#efdc9f,transparent)}
.name-greeting{color:#435844;margin:0;font-size:.85rem;line-height:1.5}
.name-silk :is(h1,h2){margin:.28rem 0 .8rem;color:#203b2a;font:600 1.67rem/1.4 Song,"Noto Serif KR Variable",Batang,serif;letter-spacing:-.042em}
.name-answer{display:flex;gap:.65rem;align-items:center;max-width:18.75rem;margin:auto}.name-input-wrap{position:relative;flex:1;min-width:0}
.name-input-wrap:after{content:"";position:absolute;inset:auto 2px 1px;height:1px;background:linear-gradient(90deg,#617761,#8ba489 66%,#a7b598);pointer-events:none}
.name-panel input{width:100%;min-width:0;min-height:48px;background:transparent;color:#203b2a;font:1rem/1.5 Read,"Pretendard Variable","Malgun Gothic",sans-serif;border:0;border-radius:2px;padding:.5rem .25rem;caret-color:#28513d}.name-panel input::placeholder{color:#4c624e;opacity:1}
.name-panel button{flex:none;display:flex;align-items:center;gap:.37rem;justify-content:center;min-height:48px;min-width:72px;padding:.55rem .8rem;border:1px solid #526c53;border-radius:14px 3px 14px 3px;background:linear-gradient(150deg,#486953,#294e39);color:#f8f4df;box-shadow:inset 0 0 0 1px #91aa8099,0 1px 2px #70826a77;cursor:pointer;font:600 1rem/1.4 Read,"Pretendard Variable","Malgun Gothic",sans-serif}
.name-panel button:active{transform:translateY(1px)}.name-panel input:focus-visible,.name-panel button:focus-visible{outline:2px solid #315e42;outline-offset:3px}.silk-grove .back:focus-visible{outline:2px solid #ffeba3;outline-offset:3px}
.name-error{margin:0;color:#633c26;font-size:.9rem;line-height:1.55}.name-error:not(:empty){margin-top:.6rem}

.name-panel *, .name-panel *::before, .name-panel *::after { box-sizing: border-box; }
.name-panel { container-type: inline-size; }
.name-silk :is(h1,h2):focus { outline: 0; }
.name-panel button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.name-panel input { box-sizing: border-box; }
.name-panel .name-error:empty { margin: 0; }
@media (min-height: 650px) { .name-silk { padding-block: 1.5rem 1.35rem; } }
@media (max-height: 530px) {
  #input-screen.silk-grove[data-step="name"] .voice { margin-top: clamp(96px, 37svh, 190px); padding-bottom: .7rem; }
}
@media (forced-colors: active) { .name-silk, .name-panel button, .name-panel input { border: 1px solid ButtonText; } }
@container (max-width: 16em) {
  .name-answer { flex-direction: column; align-items: stretch; }
  .name-input-wrap { flex: auto; }
  .name-panel button { align-self: end; }
}

/* The portrait remains stable while the four input forms change. */
#input-screen.silk-grove:is([data-step="name"],[data-step="birth"],[data-step="time"],[data-step="profile"]) {
  position:relative;isolation:isolate;display:grid;align-items:end;min-height:100svh;background:#1b3027;color:#203b2a;
}
#input-screen.silk-grove:is([data-step="name"],[data-step="birth"],[data-step="time"],[data-step="profile"]) .portrait {
  position:absolute;inset:0;width:100%;height:100%;background:#1b3027;
}
#input-screen.silk-grove:is([data-step="name"],[data-step="birth"],[data-step="time"],[data-step="profile"]) .portrait img {
  height:100svh;object-position:50% 30%;transform:none;mask-image:linear-gradient(#000 0 85%,transparent 100%);
}
#input-screen.silk-grove:is([data-step="name"],[data-step="birth"],[data-step="time"],[data-step="profile"]) .voice {
  margin-top:clamp(250px,43svh,480px);padding:0 .73rem calc(clamp(56px,7.5svh,72px) + env(safe-area-inset-bottom));background:transparent;
}
#input-screen.silk-grove:is([data-step="name"],[data-step="birth"],[data-step="time"],[data-step="profile"]) .voice::before {content:none}
.name-silk {word-break:keep-all;overflow-wrap:break-word;color-scheme:light}
.scene-panel .name-silk {padding:1.15rem 1rem 1rem;text-align:left}
.scene-panel .name-silk h1 {text-align:center;font-size:1.5rem;margin:.1rem 0 .75rem}
.scene-panel .speech {color:#435844;text-align:center;font-size:.875rem;line-height:1.5;margin-bottom:.2rem}
.scene-panel .place-hint {color:#354f3d;font-size:.875rem;line-height:1.6;margin:.65rem 0 .8rem;word-break:keep-all}
.scene-panel .calendar-choice {gap:8px;margin-top:.6rem}
.scene-panel .calendar-choice input {min-height:0;padding:0}
.scene-panel .calendar-choice span {min-height:44px;min-width:64px;padding:6px 12px;border:1px solid #6f846b;border-radius:10px 3px 10px 3px;color:#203b2a;background:#ecf1df24;font-size:1rem}
.scene-panel .calendar-choice input:checked+span {background:#345740;color:#fff7df;border-color:#3d5e43;box-shadow:inset 0 0 0 1px #abc19a66}
.scene-panel .calendar-choice input:focus-visible+span {outline:2px solid #315e42;outline-offset:3px}
.scene-panel .calendar-choice .leap {margin-left:0;gap:7px}
.scene-panel .calendar-choice .leap input {width:20px;height:20px;accent-color:#345740}
.scene-panel .calendar-choice .leap span {min-width:0;min-height:0;padding:0;border:0;background:none;color:#203b2a;box-shadow:none}
.scene-panel :is(select,input[type=text],input:not([type])) {min-width:0;min-height:48px;width:100%;padding:9px 6px;background-color:#ecf1df24;color:#203b2a;border:0;border-bottom:1px solid #658269;border-radius:3px;font:1rem/1.5 Read,"Malgun Gothic",sans-serif}
.scene-panel select option {background:#e2ead9;color:#203b2a}
.scene-panel select:focus-visible {outline:2px solid #315e42;outline-offset:3px}
.scene-panel .date-row {display:grid;grid-template-columns:minmax(0,1.3fr) repeat(2,minmax(0,1fr));gap:8px;margin-top:.85rem}
.scene-panel .date-row select {border:1px solid #526f58;border-radius:5px;background-color:rgb(237 244 224 / .88);box-shadow:inset 0 1px 0 #ffffff70,0 1px 2px #244b3220;padding:9px 6px;color:#193624}
.scene-panel .date-row select:focus-visible {background-color:#f2f7e8;outline:2px solid #315e42;outline-offset:2px}
#time-step .scene-panel .date-row {grid-template-columns:repeat(2,minmax(0,1fr))}
.scene-panel .date-row .reply-button {grid-column:1/-1;justify-self:end;width:auto;min-width:80px;height:48px;margin-top:6px}
.scene-panel .place-row {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:.65rem}
.scene-panel .place-row label {min-width:0;color:#354f3d;font-size:.875rem;font-weight:600;line-height:1.6}
.scene-panel .place-row select,.scene-panel .place-row input {margin-top:4px;font-weight:400}
.scene-panel .profile-sex {margin-top:.8rem}
.scene-panel .profile-sex legend {color:#354f3d;font-size:.875rem;font-weight:600;margin-bottom:5px}
.scene-panel button.enter {margin-top:1rem;margin-left:auto;width:auto;max-width:100%}
.scene-panel button.text-button {background:none;border:0;box-shadow:none;color:#294b36;min-height:44px;padding:7px 0;margin-top:.55rem;font-weight:500;text-decoration-thickness:1px}
.scene-panel .error {color:#7d3027;font-size:.875rem;line-height:1.5;margin-top:.5rem}
@container(max-width:16em) {
  .scene-panel .date-row, #time-step .scene-panel .date-row, .scene-panel .place-row {grid-template-columns:minmax(0,1fr)}
}
@media(max-height:530px) {
  #input-screen.silk-grove:is([data-step="name"],[data-step="birth"],[data-step="time"],[data-step="profile"]) .voice {margin-top:clamp(96px,37svh,190px);padding-bottom:calc(32px + env(safe-area-inset-bottom))}
}

