﻿/* Shared native control treatment; colors come from base.css tokens. */
:root { --tc-shadow: 0 10px 30px rgb(0 0 0 / .14); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tc-shadow: 0 10px 30px rgb(0 0 0 / .5); } }
:root[data-theme="dark"] { --tc-shadow: 0 10px 30px rgb(0 0 0 / .5); }
.tc-wrap { display:block; position:relative; min-width:0; }
.tc-wrap > select, .tc-wrap > input[type=date], .tc-wrap > input[type=time], .tc-wrap > input[type=month] { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.tc-trigger { width:100%; min-height:var(--field-height); padding:0 12px; display:flex; justify-content:space-between; align-items:center; gap:8px; text-align:left; border:1px solid var(--control); border-radius:var(--radius-control); background:var(--surface); color:var(--text); }
.tc-trigger[aria-invalid="true"] { border-color:var(--negative); }
.tc-trigger > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tc-trigger > svg { flex:none; color:var(--muted); }
.tc-trigger:focus-visible, .tc-pop button:focus-visible { outline:2px solid var(--hue); outline-offset:2px; }
.tc-pop { position:fixed; z-index:30; top:0; left:0; margin:0; width:min(320px, calc(100vw - 24px)); max-height:300px; overflow:auto; padding:8px; border:1px solid var(--border); border-radius:var(--radius-card); background:var(--surface); color:var(--text); box-shadow:var(--tc-shadow); }
.tc-pop[hidden] { display:none; }
.tc-pop.tc-time-open { width:240px; max-height:none; overflow:visible; padding:12px 10px; }
.tc-time-handle { display:none; }
.tc-time-title { display:none; }
.tc-wheels { position:relative; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); height:220px; overflow:hidden; }
.tc-wheel { min-width:0; height:220px; overflow:hidden; }
.tc-wheel-rail { height:220px; overflow-y:auto; scrollbar-width:none; scroll-snap-type:y mandatory; overscroll-behavior:contain; }
.tc-wheel-rail::-webkit-scrollbar { display:none; }
.tc-wheel-item { display:block; width:100%; height:44px; padding:0; border:0; border-radius:0; background:transparent; color:var(--muted); opacity:.55; font-size:17px; font-weight:400; scroll-snap-align:start; }
.tc-wheel-item.selected { color:var(--text); opacity:1; font-weight:500; }
.tc-time-band { position:absolute; z-index:0; pointer-events:none; top:88px; left:6px; right:6px; height:44px; border-radius:var(--radius-control); background:var(--active); }
.tc-wheel { position:relative; z-index:1; }
.tc-wheel-rail { padding-top:88px; padding-bottom:88px; height:220px; box-sizing:border-box; }
.tc-wheel-item { scroll-snap-align:center; }
.tc-wheels::before,.tc-wheels::after { content:""; position:absolute; z-index:2; left:0; right:0; height:min(40%,132px); pointer-events:none; }
.tc-wheels::before { top:0; background:linear-gradient(var(--surface),transparent); }
.tc-wheels::after { bottom:0; background:linear-gradient(transparent,var(--surface)); }
.tc-pop .tc-time-done { width:100%; margin-top:8px; min-height:36px; border:1px solid var(--control); border-radius:var(--radius-control); background:var(--text); color:var(--ground)!important; font-weight:500; text-align:center; padding:0; }
.tc-pop button { font:inherit; color:inherit; }
.tc-pop > button { display:block; width:100%; border:0; border-radius:var(--radius-control); background:none; text-align:left; padding:8px 10px; white-space:nowrap; }
.tc-pop [role=option][aria-selected="true"] { background:var(--active); font-weight:600; }
.tc-pop [role=option]:focus-visible { background:var(--active); }
.tc-pop > button:hover, .tc-grid button:hover { background:var(--active); }
.tc-pop header { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:4px; }
.tc-pop header button { border:0; background:none; border-radius:var(--radius-control); padding:6px 10px; }
.tc-grid { display:grid; grid-template-columns:repeat(7,36px); justify-content:center; gap:2px; text-align:center; }
.tc-grid button { border:0; border-radius:50%; background:none; width:36px; height:36px; padding:0; }
.tc-grid button:disabled { opacity:.35; }
.tc-grid .tc-day[aria-selected="true"] { background:var(--hue); color:var(--hue-ink); }
.tc-grid .tc-day[data-today="true"] { box-shadow:inset 0 0 0 1px var(--hue); }
.tc-grid i { min-height:30px; }
.tc-month-grid { grid-template-columns:repeat(3,1fr); }
.tc-grid .tc-month { width:auto; border-radius:var(--radius-control); }
:where(#view, #dialog-host) :is(input[type=checkbox], input[type=radio]) { appearance:none; margin:0; width:18px; height:18px; flex:none; border:1px solid var(--control); background:var(--surface); vertical-align:middle; cursor:pointer; }
input[type=checkbox] { border-radius:4px; }
input[type=radio] { border-radius:50%; }
input[type=checkbox]:checked, input[type=radio]:checked { background:var(--hue); border-color:var(--hue); }
input[type=checkbox]:checked::after { content:"✓"; color:var(--hue-ink); display:block; font-size:13px; line-height:16px; text-align:center; }
input[type=radio]:checked::after { content:""; display:block; width:8px; height:8px; margin:4px; border-radius:50%; background:var(--hue-ink); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline:2px solid var(--hue); outline-offset:2px; }
input[type=checkbox].switch { width:38px; border-radius:99px; position:relative; }
input[type=checkbox].switch::after { content:""; position:absolute; width:12px;height:12px;left:2px;top:2px;border-radius:50%;background:var(--muted);transition:transform .15s; }
input[type=checkbox].switch:checked::after { content:""; background:var(--hue-ink); transform:translateX(18px); }
input[type=number] { appearance:textfield; }
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button { appearance:none; margin:0; }
input[type=tel] { inputmode:numeric; }
/* 28px button centred in the 40px field (38px inside the border). */
.field input[type=file] { padding: 0 5px; line-height: 38px; }
input[type=file]::file-selector-button { height: 28px; padding: 0 10px; margin-right: 10px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--raised); color: var(--text); font: inherit; font-size: 13px; line-height: 26px; vertical-align: top; margin-top: 5px; cursor: pointer; }
input[type=search] { appearance:none; }
.tc-search-wrap { display:block; position:relative; }
.tc-search-wrap::before { content:""; position:absolute; z-index:1; left:14px; top:50%; width:10px; height:10px; border:1.5px solid var(--muted); border-radius:50%; transform:translateY(-60%); pointer-events:none; }
.tc-search-wrap::after { content:""; position:absolute; z-index:1; left:25px; top:calc(50% + 4px); width:6px; height:1.5px; background:var(--muted); transform:rotate(45deg); transform-origin:left center; pointer-events:none; }
#view .tc-search-wrap > input[type=search], #dialog-host .tc-search-wrap > input[type=search] { width:100%; padding-left:36px; padding-right:42px; background-image:none; }
.tc-search-wrap input[type=search]::-webkit-search-cancel-button { display:none; }
.tc-search-clear { position:absolute; right:4px; top:50%; transform:translateY(-50%); width:30px; height:30px; border:0; border-radius:50%; background:var(--raised); color:var(--muted); font-size:20px; }
.tc-file-name { display:block; margin-top:5px; color:var(--muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; }
@media (max-width:720px) { .tc-pop { position:fixed; top:auto; bottom:0; left:0; right:0; width:100%; max-height:65vh; border-radius:16px 16px 0 0; padding:16px; } .tc-pop.tc-time-open { width:auto; max-height:none; padding:8px 16px calc(8px + env(safe-area-inset-bottom)); border-radius:16px 16px 0 0; } .tc-time-handle { display:block; width:36px; height:4px; margin:0 auto 6px; border-radius:99px; background:var(--muted); opacity:.5; } .tc-time-title { display:block; margin:0 0 2px; text-align:center; font-size:16px; } .tc-time-open .tc-time-band { left:0; right:0; } .tc-time-open .tc-time-done { margin-top:4px; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none!important; scroll-behavior:auto!important; } }
.tc-number { display:flex; align-items:center; }
.tc-number > input { flex:1; min-width:0; }
.tc-number > button { height:var(--field-height); min-width:38px; border:1px solid var(--control); background:var(--raised); color:var(--text); }
/* 의도: 숫자 + −/+ 는 한 덩어리 컨트롤. 입력칸 왼쪽만 둥글고, − 는 각지게, + 는 오른쪽만 둥글게. 겹치는 테두리는 1px로 합침. */
.tc-number > input { border-radius:var(--radius-control) 0 0 var(--radius-control) !important; }
.tc-number > button { margin-left:-1px; border-radius:0; font-size:16px; }
.tc-number > button:last-child { border-radius:0 var(--radius-control) var(--radius-control) 0; }
.tc-number > button:hover { background:var(--active); }
input[type=search].tc-search { padding-right:36px; background-image: radial-gradient(circle at 15px 15px, transparent 5px, var(--muted) 5px, var(--muted) 6px, transparent 6px), linear-gradient(45deg,transparent 45%,var(--muted) 45%,var(--muted) 55%,transparent 55%); background-size:24px 24px,7px 7px; background-position:4px center,19px 23px; background-repeat:no-repeat; }
