:root {
  --bg: #111111;
  --bg-deep: #050505;
  --surface: rgb(28 28 28 / 82%);
  --surface-solid: #1c1c1c;
  --surface-raised: #282828;
  --line: rgb(255 255 255 / 15%);
  --line-strong: rgb(255 255 255 / 25%);
  --text: #f5f5f5;
  --muted: #aaaaaa;
  --brand: #ffffff;
  --brand-soft: rgb(255 255 255 / 11%);
  --green: #65dc98;
  --green-soft: rgb(101 220 152 / 14%);
  --red: #f2747b;
  --red-soft: rgb(242 116 123 / 14%);
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  --bg: #fafafa;
  --bg-deep: #e9e9e9;
  --surface: rgb(255 255 255 / 82%);
  --surface-solid: #ffffff;
  --surface-raised: #f0f0f0;
  --line: rgb(0 0 0 / 14%);
  --line-strong: rgb(0 0 0 / 25%);
  --text: #1b1b1b;
  --muted: #707070;
  --brand: #222222;
  --brand-soft: rgb(0 0 0 / 8%);
  --green: #168f56;
  --green-soft: rgb(22 143 86 / 12%);
  --red: #c83d49;
  --red-soft: rgb(200 61 73 / 11%);
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: linear-gradient(150deg, var(--bg) 0%, var(--bg-deep) 100%);
}

:root[data-theme="light"] body {
  background: linear-gradient(150deg, var(--bg) 0%, var(--bg-deep) 100%);
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .48; }
h1, h2, h3, p { margin: 0; }

.ambient-glow { display: none; }
.glow-one { top: 12rem; right: -20rem; background: var(--brand); }
.glow-two { bottom: -20rem; left: -19rem; background: #3cae9d; animation-delay: -7s; }
.shell { width: min(1320px, calc(100% - 24px)); margin: 0 auto; padding: clamp(24px, 5vw, 44px) 0 clamp(40px, 8vw, 68px); animation: page-in .5s cubic-bezier(.2, .8, .2, 1) both; }
.topbar, .toolbar, .filters, .date-control, .brand, .summary, .panel-heading, .member-identity, .detail-profile, .detail-stats { display: flex; align-items: center; }
.topbar { justify-content: space-between; gap: 24px; margin-bottom: clamp(18px, 3vw, 28px); }
.brand { gap: clamp(8px, 2vw, 13px); }
.brand-visual { width: clamp(38px, 5vw, 45px); height: clamp(38px, 5vw, 45px); flex: 0 0 auto; }
.brand-mark, .server-icon { display: grid; width: 100%; height: 100%; place-items: center; border: 1px solid rgb(255 255 255 / 16%); border-radius: 14px; box-shadow: 0 12px 28px rgb(0 0 0 / 34%), inset 0 1px 0 rgb(255 255 255 / 20%); }
.brand-mark[hidden], .server-icon[hidden] { display: none; }
.brand-mark { background: linear-gradient(145deg, #f2f2f2, #bdbdbd); color: #151515; font-size: clamp(24px, 4vw, 31px); font-weight: 700; line-height: 1; }
.server-icon { display: block; background: var(--surface-raised); object-fit: cover; }
h1 { font-size: clamp(20px, 3vw, 31px); letter-spacing: -.035em; line-height: 1.15; }
h2 { font-size: clamp(17px, 2.5vw, 20px); letter-spacing: -.02em; }
.eyebrow { margin-bottom: 5px; color: var(--muted); font-size: clamp(9px, 1.2vw, 10px); font-weight: 700; letter-spacing: .16em; }
.live-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: clamp(11px, 1.5vw, 13px); white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgb(101 220 152 / 45%); animation: live-pulse 2.4s ease-out infinite; }
.header-actions { display: flex; align-items: center; gap: clamp(6px, 1.5vw, 13px); }
.theme-toggle, .logout-button { display: inline-flex; min-height: 33px; align-items: center; gap: 6px; padding: 0 clamp(8px, 1.5vw, 10px); border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: rgb(255 255 255 / 4%); font-size: clamp(11px, 1.5vw, 12px); font-weight: 700; transition: color .18s ease, border-color .18s ease, background .18s ease; }
.theme-toggle:hover { border-color: rgb(255 255 255 / 45%); color: var(--text); background: var(--brand-soft); }
.theme-toggle[aria-pressed="true"] { color: var(--text); background: var(--brand-soft); }
.logout-button:hover { border-color: rgb(255 255 255 / 45%); color: var(--text); background: var(--brand-soft); }

.toolbar { position: relative; z-index: 10; display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2.2fr); align-items: end; gap: clamp(12px, 2.5vw, 22px); padding: clamp(14px, 2.5vw, 18px) clamp(14px, 2.5vw, 20px); overflow: visible; border: 1px solid var(--line); border-radius: clamp(14px, 2vw, 17px); background: linear-gradient(135deg, rgb(34 34 34 / 92%), rgb(22 22 22 / 76%)); box-shadow: 0 18px 42px rgb(0 0 0 / 22%); backdrop-filter: blur(16px); }
.toolbar::before { position: absolute; top: 0; right: 0; left: 0; height: 1px; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 30%), transparent); content: ""; }
.date-control { width: 100%; gap: clamp(6px, 1.5vw, 9px); min-width: 0; align-items: flex-end; }
.date-label { position: relative; display: grid; flex: 1; min-width: 0; gap: 5px; color: var(--muted); font-size: clamp(9px, 1.2vw, 10px); font-weight: 700; letter-spacing: .08em; }
input[type="search"], select, .custom-dropdown-button, #password { min-height: 40px; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--text); background: rgb(12 12 12 / 74%); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
input:focus, select:focus, .custom-dropdown-button:focus-visible { border-color: rgb(255 255 255 / 72%); box-shadow: 0 0 0 3px rgb(255 255 255 / 14%); background: rgb(20 20 20 / 94%); }
select, .custom-dropdown-button { height: 40px; width: 100%; padding: 0 40px 0 12px; appearance: none; -webkit-appearance: none; color-scheme: dark; background: linear-gradient(135deg, rgb(28 28 28 / 96%), rgb(13 13 13 / 96%)); font-weight: 650; }
select:hover, .custom-dropdown-button:hover:not(:disabled) { border-color: var(--line-strong); background: linear-gradient(135deg, rgb(39 39 39 / 98%), rgb(19 19 19 / 98%)); }

/* ===== 완벽 정렬 아이콘 버튼 ===== */
.icon-button, .dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 39px;
  height: 39px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: rgb(255 255 255 / 5%);
  font-size: 20px;
  line-height: 1;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.icon-button:not(:disabled):hover, .dialog-close:hover {
  border-color: rgb(255 255 255 / 42%);
  background: var(--brand-soft);
  transform: translateY(-1px);
}
.nav-chevron { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.25; }
.dialog-close-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2.25; }

/* ===== 네이티브 드롭다운 화살표 (우리가 맞춘 그대로) ===== */
.date-label::after,
.select-label::after {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: clamp(16px, 2vw, 20px);
  height: clamp(16px, 2vw, 20px);
  border-radius: 6px;
  color: #d4d4d4;
  background: rgb(255 255 255 / 7%);
  font-size: clamp(14px, 1.8vw, 18px);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}
.date-label::after {
  content: "▾";
  top: calc(100% - 20px);
  right: clamp(5px, 1vw, 9px);
  transform: translateY(-50%);
}
.select-label::after {
  content: "▾";
  top: 50%;
  right: clamp(5px, 1vw, 9px);
  transform: translateY(-50%);
}

/* ===== 네이티브 드롭다운 옵션 ===== */
option {
  background-color: #1c1c1c;
  color: #f5f5f5;
  padding: 8px 12px;
  font-weight: 500;
}
:root[data-theme="light"] option {
  background-color: #ffffff;
  color: #1b1b1b;
}

.date-status { align-self: flex-end; padding: 0 4px 11px; color: var(--muted); font-size: clamp(10px, 1.5vw, 12px); white-space: nowrap; }
.filters { display: grid; grid-template-columns: minmax(160px, 1.2fr) minmax(130px, 0.8fr) minmax(120px, 0.7fr); gap: clamp(6px, 1.5vw, 9px); min-width: 0; width: 100%; }
.search { position: relative; display: flex; align-items: center; }
.search .search-icon { position: absolute; top: 50%; left: 11px; width: 18px; height: 18px; color: var(--muted); fill: none; pointer-events: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; transform: translateY(-50%); }
.search input { width: 100%; padding: 0 12px 0 35px; }
.select-label { position: relative; min-width: 0; }

/* ===== 커스텀 드롭다운 (JS 연동, 화살표 통일 완료) ===== */
.date-label.custom-dropdown-ready::after,
.select-label.custom-dropdown-ready::after { display: none; }
.custom-dropdown { position: relative; display: block; width: 100%; min-width: 0; }
.custom-dropdown-native { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.custom-dropdown-button { position: relative; display: block; overflow: hidden; text-align: left; }
.date-label .custom-dropdown-button { font-size: clamp(12px, 1.7vw, 14px); }

/* ✅ 기존 span 화살표 숨기고, 버튼에 ::after로 통일 */
.custom-dropdown-arrow { display: none; }
.custom-dropdown-button::after {
  content: "▾";
  position: absolute;
  top: 50%;
  right: clamp(8px, 1vw, 11px);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
  transition: transform .16s ease;
}
.custom-dropdown.is-open .custom-dropdown-button::after {
  transform: translateY(-50%) rotate(180deg);
}

.custom-dropdown-menu { position: absolute; z-index: 20; top: calc(100% + 7px); right: 0; left: 0; max-height: 228px; padding: 5px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-solid); box-shadow: 0 16px 30px rgb(0 0 0 / 24%); animation: dropdown-menu-in .16s cubic-bezier(.2, .8, .2, 1) both; }
.custom-dropdown-menu[hidden] { display: none; }
.custom-dropdown-option { display: block; width: 100%; min-height: 35px; padding: 0 10px; overflow: hidden; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 650; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.custom-dropdown-option:hover, .custom-dropdown-option:focus-visible, .custom-dropdown-option.is-selected { outline: none; color: var(--text); background: var(--brand-soft); }
@keyframes dropdown-menu-in { from { opacity: 0; transform: translateY(-5px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

.summary { margin: clamp(14px, 2vw, 20px) 0; overflow: hidden; border: 1px solid var(--line); border-radius: clamp(12px, 2vw, 14px); background: var(--surface); box-shadow: 0 12px 34px rgb(0 0 0 / 12%); backdrop-filter: blur(13px); }
.summary > div { flex: 1 1 0; min-width: 0; padding: clamp(12px, 2vw, 16px) clamp(14px, 2.5vw, 20px); border-right: 1px solid var(--line); transition: background .2s ease; }
.summary > div:hover { background: rgb(255 255 255 / 3%); }
.summary > div:last-child { border-right: 0; }
.summary-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: clamp(10px, 1.5vw, 12px); }
.summary strong { font-size: clamp(13px, 1.8vw, 15px); font-weight: 700; letter-spacing: -.01em; }

.activity-panel { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: clamp(14px, 2vw, 17px); background: linear-gradient(145deg, rgb(38 38 38 / 93%), rgb(23 23 23 / 89%)); box-shadow: 0 22px 56px rgb(0 0 0 / 24%); backdrop-filter: blur(14px); }
.activity-panel::before { position: absolute; top: 0; right: 0; left: 0; height: 1px; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 22%), transparent); content: ""; }
.panel-heading { justify-content: space-between; padding: clamp(16px, 2.5vw, 24px) clamp(14px, 2.5vw, 23px) clamp(14px, 2.5vw, 19px); }
.updated-time { color: var(--muted); font-size: clamp(10px, 1.5vw, 12px); font-variant-numeric: tabular-nums; }
.table-head, .member-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(100px, 0.8fr) minmax(90px, 0.7fr) minmax(100px, 0.8fr); column-gap: clamp(10px, 2vw, 18px); align-items: center; }
.table-head { padding: 11px clamp(14px, 2.5vw, 23px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); background: rgb(7 9 15 / 19%); font-size: clamp(10px, 1.3vw, 11px); font-weight: 700; letter-spacing: .04em; }
.member-row { width: 100%; padding: clamp(10px, 1.8vw, 14px) clamp(14px, 2.5vw, 23px); border: 0; border-bottom: 1px solid var(--line); color: inherit; background: transparent; text-align: left; animation: row-in .35s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--row-index) * 35ms); transition: background .18s ease, transform .18s ease; }
.member-row:last-child { border-bottom: 0; }
.member-row:hover, .member-row:focus-visible { outline: none; background: linear-gradient(90deg, rgb(255 255 255 / 11%), rgb(255 255 255 / 2%)); transform: translateX(3px); }
.member-identity { min-width: 0; gap: clamp(8px, 1.5vw, 12px); }
.avatar, .avatar-fallback { width: clamp(34px, 5vw, 40px); height: clamp(34px, 5vw, 40px); flex: 0 0 auto; border: 1px solid rgb(255 255 255 / 12%); border-radius: 50%; object-fit: cover; box-shadow: 0 4px 12px rgb(0 0 0 / 18%); }
.avatar-fallback { display: grid; place-items: center; background: linear-gradient(145deg, #5a5a5a, #242424); color: white; font-size: clamp(11px, 1.8vw, 13px); font-weight: 700; }
.member-copy { min-width: 0; }
.member-name, .member-handle { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-name { font-size: clamp(12px, 1.8vw, 14px); font-weight: 700; }
.member-handle { margin-top: 3px; color: var(--muted); font-size: clamp(10px, 1.5vw, 12px); }
.presence { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--green); font-size: clamp(10px, 1.3vw, 11px); font-weight: 700; }
.presence::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; box-shadow: 0 0 8px currentColor; }
.duration { color: #f8f9ff; font-size: clamp(12px, 1.8vw, 14px); font-weight: 700; font-variant-numeric: tabular-nums; }
.permission { display: inline-flex; width: fit-content; align-items: center; gap: 6px; padding: clamp(4px, 0.8vw, 5px) clamp(7px, 1.2vw, 9px); border: 1px solid transparent; border-radius: 99px; font-size: clamp(10px, 1.3vw, 12px); font-weight: 700; }
.permission::before { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: currentColor; content: ""; }
.permission.yes { border-color: rgb(101 220 152 / 18%); color: #bdf5d2; background: var(--green-soft); }
.permission.no { border-color: rgb(242 116 123 / 16%); color: #ffc3c8; background: var(--red-soft); }
.permission-time { color: var(--muted); font-size: clamp(9px, 1.2vw, 11px); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.permission-time.is-empty { opacity: .65; }
.empty-state, .error-state { padding: 42px 23px; color: var(--muted); text-align: center; }
.error-state { color: #ffc3c8; }

.member-dialog { position: fixed; top: 50%; left: 50%; translate: -50% -50%; margin: 0; width: min(560px, calc(100% - 32px)); max-height: min(730px, calc(100% - 32px)); padding: clamp(20px, 3vw, 29px); overflow: auto; border: 1px solid var(--line-strong); border-radius: clamp(14px, 2vw, 18px); color: var(--text); background: #1c1c1c; box-shadow: 0 24px 90px rgb(0 0 0 / 65%); animation: dialog-in .22s ease-out; }
.member-dialog::backdrop { background: rgb(5 6 10 / 72%); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; top: 15px; right: 15px; font-size: 20px; }
.detail-profile { gap: clamp(8px, 1.5vw, 13px); padding-right: 45px; }
.detail-profile .avatar, .detail-profile .avatar-fallback { width: clamp(44px, 6vw, 53px); height: clamp(44px, 6vw, 53px); font-size: clamp(14px, 2vw, 17px); }
.detail-stats { gap: clamp(6px, 1.5vw, 10px); margin: clamp(16px, 2.5vw, 24px) 0; }
.detail-stat { flex: 1; padding: clamp(10px, 1.8vw, 14px); border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); }
.detail-stat span { display: block; color: var(--muted); font-size: clamp(10px, 1.3vw, 11px); }
.detail-stat strong { display: block; margin-top: 5px; font-size: clamp(12px, 1.8vw, 14px); font-variant-numeric: tabular-nums; }
.history-heading { margin: 12px 0 8px; font-size: clamp(12px, 1.8vw, 14px); }
.history-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: clamp(11px, 1.5vw, 13px); }
.history-date-copy { display: grid; min-width: 0; gap: 3px; }
.history-permission-time { color: var(--green); font-size: clamp(9px, 1.2vw, 11px); font-weight: 700; font-variant-numeric: tabular-nums; }
.history-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.login-body { display: grid; min-height: 100vh; place-items: center; padding: 16px; }
.login-card { width: min(400px, 100%); padding: clamp(20px, 5vw, 32px); border: 1px solid var(--line); border-radius: clamp(14px, 2vw, 18px); background: var(--surface-solid); box-shadow: 0 22px 60px rgb(0 0 0 / 26%); }
.login-card .brand-visual { margin-bottom: 20px; }
.login-copy { margin: 9px 0 24px; color: var(--muted); font-size: clamp(12px, 2vw, 14px); }
.login-card form { display: grid; gap: 8px; }
.login-card label { font-size: clamp(11px, 1.8vw, 13px); font-weight: 700; }
.login-card .login-error { min-height: 14px; margin: -3px 0 0; padding: 0; color: #ffc3c8; font-size: 11px; line-height: 1.25; text-align: left; }
.password-field { position: relative; width: 100%; }
#password { width: 100%; padding: 0 43px 0 11px; }
.password-field.has-error #password { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.password-toggle { position: absolute; top: 50%; right: 7px; display: grid; width: 28px; height: 28px; padding: 0; place-items: center; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; transform: translateY(-50%); transition: color .18s ease, background .18s ease; }
.password-toggle:hover, .password-toggle:focus-visible { color: var(--text); background: rgb(255 255 255 / 8%); outline: none; }
.password-toggle:focus-visible { box-shadow: 0 0 0 2px rgb(255 255 255 / 38%); }
.password-toggle-icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.password-toggle .eye-closed, .password-toggle.is-visible .eye-open { display: none; }
.password-toggle.is-visible .eye-closed { display: block; }
.primary-button { min-height: 41px; margin-top: 8px; border: 1px solid rgb(255 255 255 / 18%); border-radius: 9px; color: #111111; background: linear-gradient(135deg, #ffffff, #cfcfcf); box-shadow: 0 10px 22px rgb(0 0 0 / 28%); font-weight: 700; transition: transform .18s ease, filter .18s ease; }
.primary-button:hover { filter: brightness(1.07); transform: translateY(-1px); }

.login-card { animation: login-card-in .48s cubic-bezier(.2, .8, .2, 1) both; }
.login-card .brand-visual { animation: login-brand-in .5s cubic-bezier(.2, .9, .2, 1) .08s both; }
.login-card .eyebrow, .login-card h1, .login-card .login-copy, .login-card label, .login-card .primary-button { animation: login-item-in .4s cubic-bezier(.2, .8, .2, 1) both; }
.login-card .eyebrow { animation-delay: .13s; }
.login-card h1 { animation-delay: .17s; }
.login-card .login-copy { animation-delay: .21s; }
.login-card label { animation-delay: .26s; }
.login-card .password-field { transition: transform .18s ease, filter .18s ease; }
.login-card .password-field #password { animation: login-item-in .4s cubic-bezier(.2, .8, .2, 1) .3s both; }
.login-card .password-field .password-toggle { animation: login-control-in .4s cubic-bezier(.2, .8, .2, 1) .3s both; }
.login-card .primary-button { animation-delay: .35s; }
.password-field:focus-within { filter: brightness(1.05); transform: translateY(-1px); }
.password-toggle { transition: color .18s ease, background .18s ease, transform .18s ease; }
.password-toggle.is-visible .eye-closed, .password-toggle:not(.is-visible) .eye-open { animation: password-icon-in .18s cubic-bezier(.2, .8, .2, 1) both; }
.login-card .login-error:not([hidden]) { animation: login-error-in .22s cubic-bezier(.2, .8, .2, 1) both; }
.password-field.has-error { animation: login-input-shake .32s ease-in-out; }
.primary-button:active { transform: translateY(0) scale(.98); }

:root[data-theme="light"] .toolbar { background: linear-gradient(135deg, rgb(255 255 255 / 96%), rgb(242 242 242 / 88%)); box-shadow: 0 18px 42px rgb(0 0 0 / 10%); }
:root[data-theme="light"] input[type="search"],
:root[data-theme="light"] select,
:root[data-theme="light"] .custom-dropdown-button,
:root[data-theme="light"] #password { background: #ffffff; color: var(--text); }
:root[data-theme="light"] input:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] .custom-dropdown-button:focus-visible { background: #ffffff; }
:root[data-theme="light"] input:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] .custom-dropdown-button:focus-visible { border-color: rgb(0 0 0 / 55%); box-shadow: 0 0 0 3px rgb(0 0 0 / 10%); }
:root[data-theme="light"] .icon-button,
:root[data-theme="light"] .dialog-close,
:root[data-theme="light"] .theme-toggle,
:root[data-theme="light"] .logout-button { background: rgb(0 0 0 / 5%); }
:root[data-theme="light"] .icon-button:not(:disabled):hover,
:root[data-theme="light"] .dialog-close:hover,
:root[data-theme="light"] .theme-toggle:hover,
:root[data-theme="light"] .logout-button:hover { border-color: rgb(0 0 0 / 38%); }
:root[data-theme="light"] .date-label::after,
:root[data-theme="light"] .select-label::after { color: #555555; background: rgb(0 0 0 / 8%); }
:root[data-theme="light"] .activity-panel { background: linear-gradient(145deg, rgb(255 255 255 / 96%), rgb(247 247 247 / 91%)); box-shadow: 0 22px 56px rgb(0 0 0 / 11%); }
:root[data-theme="light"] .table-head { background: rgb(0 0 0 / 5%); }
:root[data-theme="light"] .member-row:hover,
:root[data-theme="light"] .member-row:focus-visible { background: linear-gradient(90deg, rgb(0 0 0 / 9%), rgb(0 0 0 / 2%)); }
:root[data-theme="light"] .duration { color: var(--text); }
:root[data-theme="light"] .permission.yes { color: #157246; border-color: rgb(22 143 86 / 20%); }
:root[data-theme="light"] .permission.no { color: #ad3440; border-color: rgb(200 61 73 / 18%); }
:root[data-theme="light"] .member-dialog { background: #ffffff; box-shadow: 0 24px 90px rgb(0 0 0 / 20%); }
:root[data-theme="light"] .member-dialog::backdrop { background: rgb(0 0 0 / 28%); }
:root[data-theme="light"] .login-card { background: rgb(255 255 255 / 94%); box-shadow: 0 22px 60px rgb(0 0 0 / 14%); }
:root[data-theme="light"] .login-card .login-error { color: #ad3440; }
:root[data-theme="light"] .primary-button { color: #ffffff; background: linear-gradient(135deg, #242424, #050505); box-shadow: 0 10px 22px rgb(0 0 0 / 22%); }

html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after { transition-property: color, background, background-color, border-color, box-shadow, fill, stroke; transition-duration: .2s; transition-timing-function: cubic-bezier(.2, .7, .2, 1); }
::view-transition-old(root) { animation: theme-fade-out .2s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: theme-fade-in .2s cubic-bezier(0, 0, .2, 1) both; }

@keyframes page-in { from { opacity: 0; filter: blur(7px); transform: translateY(14px) scale(.99); } to { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); } }
@keyframes row-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: scale(1); } }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgb(101 220 152 / 42%); } 70% { box-shadow: 0 0 0 8px rgb(101 220 152 / 0%); } 100% { box-shadow: 0 0 0 0 rgb(101 220 152 / 0%); } }
@keyframes drift { from { transform: translate3d(-16px, -7px, 0) scale(.96); } to { transform: translate3d(16px, 10px, 0) scale(1.05); } }
@keyframes theme-fade-out { to { opacity: 0; } }
@keyframes theme-fade-in { from { opacity: 0; } }
@keyframes login-card-in { from { opacity: 0; filter: blur(10px); transform: translateY(18px) scale(.96); } to { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); } }
@keyframes login-brand-in { from { opacity: 0; transform: translateY(8px) scale(.72) rotate(-7deg); } to { opacity: 1; transform: translateY(0) scale(1) rotate(0); } }
@keyframes login-item-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes login-control-in { from { opacity: 0; filter: blur(2px); } to { opacity: 1; filter: blur(0); } }
@keyframes password-icon-in { from { opacity: 0; transform: scale(.65) rotate(-16deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes login-error-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes login-input-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 55% { transform: translateX(4px); } 78% { transform: translateX(-2px); } }

@media (prefers-reduced-motion: reduce) {
  html.theme-transition, html.theme-transition *, html.theme-transition *::before, html.theme-transition *::after { transition: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .login-card, .login-card *, .password-field { animation: none !important; transition: none !important; }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 1320px); padding-top: 24px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .toolbar { display: flex; align-items: flex-start; flex-direction: column; }
  .header-actions { flex-wrap: wrap; padding-left: 2px; }
  .live-state { padding-left: 2px; }
  .date-control { width: 100%; }
  .date-label { flex: 1; min-width: 0; }
  .date-status { display: none; }
  .filters { display: flex; width: 100%; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; }
  .select-label { flex: 1 1 0; }
  .summary { flex-wrap: wrap; }
  .summary > div { min-width: 50%; border-bottom: 1px solid var(--line); }
  .summary > div:nth-child(2) { border-right: 0; }
  .summary > div:last-child { border-bottom: 0; }
  .table-head { display: none; }
  .member-row { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; padding: 14px; }
  .member-identity { grid-row: span 3; }
  .duration { grid-column: 2; grid-row: 1; justify-self: end; }
  .permission { grid-column: 2; grid-row: 2; justify-self: end; }
  .permission-time { grid-column: 2; grid-row: 3; justify-self: end; }
  .permission-time:not(.is-empty)::before { content: "허가 처리 "; }
  .panel-heading { padding: 20px 14px 17px; }
  .updated-time { display: none; }
  .detail-stats { align-items: stretch; flex-direction: column; }
}

@media (max-width: 1060px) and (min-width: 761px) {
  .toolbar { grid-template-columns: 1fr; gap: 14px; }
  .date-control { width: auto; }
  .filters { grid-template-columns: minmax(200px, 1fr) minmax(160px, 0.8fr) minmax(140px, 0.7fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
