/* 시대 밀개와 접을 수 있는 설명을 화면 아래 작은 영역에 둔다. */
#time-panel{position:absolute;z-index:12;bottom:90px;left:50%;transform:translateX(-50%);width:min(620px,calc(100% - 20px));box-sizing:border-box;max-height:30dvh;overflow:auto;background:#17251ff5;color:#f3eee1;border:1px solid #a69876;border-radius:12px;padding:10px;font-size:17px;}
#time-panel[hidden]{display:none;}
.time-ticks{display:flex;justify-content:space-between;font-size:15px;}
#time-panel>strong{display:block;}#time-panel>input{width:100%;min-height:44px;accent-color:#e8c68c;}
#time-panel>button{float:right;min-height:44px;font-size:15px;}
#time-panel summary{min-height:44px;line-height:44px;cursor:pointer;}
#time-panel p{font-size:15px;margin:6px 0;word-break:keep-all;}
#time-panel .time-notice{font-size:15px;}
#viewer[data-walk="true"] #visitor-toolbar>#time-open{display:block;flex:1;min-height:44px;font-size:15px;}

/* 다른 장소 패널은 시대를 종료하지 않고 시간 조작부만 잠시 가린다. */
#time-panel[data-covered="true"]{visibility:hidden;pointer-events:none;}
#time-panel{bottom:max(90px,calc(env(safe-area-inset-bottom) + 90px));}
#time-panel .time-estimate>summary{font-size:15px;line-height:44px;min-height:44px;color:#f1d6a2;}
#time-panel .time-estimate{clear:both;}
/* 선택 띠는 고정 높이, 설명만 별도의 카드에서 읽는다. */
#time-panel,#time-heading,#time-card,#time-compact{position:absolute;z-index:14;box-sizing:border-box;color:#f3eee1;background:#17251ff5;border:1px solid #a69876;border-radius:8px;right:16px;left:auto;transform:none;width:min(560px,calc(100% - 32px));font-size:15px;}
#time-panel{padding:0;overflow:visible;max-height:none;height:48px;}
#time-heading{height:44px;display:flex;align-items:center;gap:4px;padding:0 4px;}
#time-heading strong{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#time-heading button,#time-panel button,#time-compact,#time-card button{min-height:44px;font-size:15px;}
#time-ticks{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:2px;}
#time-ticks button{padding:2px;min-width:0;}
#time-ticks button[aria-pressed=true]{background:#e8c68c;color:#17251f;}
#time-card{max-height:40dvh;overflow:auto;padding:12px;width:min(400px,calc(100% - 24px));}
#time-card p{margin:8px 0;font-size:17px;word-break:keep-all;}
/* 한국어 밖에서는 style.css 의 「보통 줄바꿈」을 위 keep-all 이 덮어, 띄어쓰기 없는 중국어·일본어 설명 줄이 카드 폭을 넘어 잘렸다(320 zh 348/282px · ja 488/282px) → 글 칸도 보통 줄바꿈(lifeP48). */
html[lang]:not([lang=ko]) :is(#time-card,#time-panel) p{word-break:normal;}
#time-card button{display:block;margin-left:auto;}
#time-progress{position:absolute;bottom:100%;right:0;padding:4px;background:#17251ff5;margin:0;font-size:13px;}
#time-progress{bottom:calc(100% + 44px);left:auto;padding:3px 8px;min-height:20px;color:#fff;background:#17251ff5;border-bottom:3px solid #e8c68c;white-space:nowrap;}
#time-compact{width:auto;max-width:calc(100% - 24px);padding:0 12px;}
#time-panel[hidden],#time-heading[hidden],#time-card[hidden],#time-compact[hidden],#time-progress[hidden]{display:none;}
@media (max-width:640px), (max-height:500px), (pointer:coarse){
 #time-panel{left:6px;right:6px;width:auto;}
 #time-heading{left:6px;right:6px;width:auto;height:44px;transition:opacity .2s;}
 #time-heading[data-faded=true]{opacity:.3;}#time-heading:focus-within{opacity:1;}
 #time-heading #time-now{display:none;}#time-heading strong{font-size:13px;}
 #time-heading button{padding:0 6px;font-size:13px;min-width:44px;}
 #viewer[data-time-strip=true] #mobile-story-strip{visibility:hidden;pointer-events:none;}
 #time-card{left:6px;right:6px;width:auto;max-height:40dvh;}
 #time-progress{font-size:13px;white-space:nowrap;}
 #time-progress{position:fixed;top:calc(var(--palace-header-bottom,120px) + 52px);bottom:auto;left:6px;right:auto;max-width:calc(100% - 12px);}
 #time-compact{top:calc(var(--palace-header-bottom,120px) + 6px);bottom:auto!important;right:6px;min-height:44px;}
 #viewer[data-time-active=true] #auto-status{top:calc(var(--palace-header-bottom,120px) + 56px);}
}
@media (max-height:500px) and (orientation:landscape){
 #time-heading{top:48px!important;left:auto;right:6px;width:55%;height:44px;bottom:auto!important;}
 #time-panel{left:auto;right:6px;width:55%;bottom:48px!important;}
 #time-card{left:auto;right:6px;top:94px!important;bottom:98px!important;width:45%;max-height:none;}
 #time-compact{top:48px!important;}#time-progress{top:94px;left:auto;right:6px;}
}
@media(max-width:640px), (pointer:coarse){
 #viewer[data-time-strip=true] #tour-player:not([hidden]){position:fixed;left:6px;right:6px;bottom:calc(var(--palace-time-bottom,56px) + 50px);z-index:16;}
 #viewer:has(#time-progress:not([hidden])) #time-card{top:calc(var(--palace-header-bottom,108px) + 88px)!important;}
}
@media(max-height:500px) and (orientation:landscape){
 #time-heading{top:calc(var(--palace-header-bottom,70px) + 4px)!important;}
 #time-progress{top:calc(var(--palace-header-bottom,70px) + 50px);}
 #time-card{top:calc(var(--palace-header-bottom,70px) + 78px)!important;bottom:100px!important;}
 #time-compact{top:calc(var(--palace-header-bottom,70px) + 4px)!important;}
}
