:root {
    color-scheme: light;
    --primary: #087f8c;
    --primary-ink: #087f8c;
    --primary-soft: #e8f5f4;
    --ink: #1f2937;
    --muted: #4b5563;
    --line: #dfe4eb;
    --bg: #f5f7fa;
    --surface: #fff;
    --surface-soft: #f8fafc;
    --hover-surface: #f1f4f8;
    --row-alt: #fafbfc;
    --brand: #075861;
    --danger: #c83e3e;
    --edit-bg: #eaf2fc;
    --edit-line: #bfd3ef;
    --edit-ink: #285f9c;
    --secondary-bg: #eef1f5;
    --secondary-line: #d4dae2;
    --secondary-ink: #3e4a59;
    --shadow: 0 7px 22px rgba(31, 41, 55, .055);
    --sidebar-width: 242px;
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #a7cecc var(--surface-soft); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", Arial, sans-serif; font-size: 14px; line-height: 1.5; }
button, input, textarea { font: inherit; }
select { font: inherit; }
[hidden] { display: none !important; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #99cfcc; outline-offset: 2px; }
h1, h2, p { margin: 0; }
h1 { font-size: 25px; letter-spacing: -1px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
.muted, small { color: var(--muted); font-size: 12px; }
.brand { display: flex; align-items: center; color: var(--brand); padding: 0 12px; white-space: nowrap; }
.brand strong { font-size: 19px; font-weight: 800; letter-spacing: 0; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .5px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-shrink: 0; min-height: 32px; min-width: 64px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 400; line-height: 1.25; white-space: nowrap; }
.button:hover { background: var(--hover-surface); }
.button.primary { background: var(--primary); border-color: var(--primary); color: white; }
.button.primary:hover { background: #066c77; }
.button.query { background: var(--primary-soft); color: var(--primary-ink); }
.button.query:hover { border-color: var(--primary); }
.button.edit { background: var(--edit-bg); border-color: var(--edit-line); color: var(--edit-ink); }
.button.edit:hover { background: #dfeafb; }
.button.secondary { background: var(--secondary-bg); border-color: var(--secondary-line); color: var(--secondary-ink); }
.button.secondary:hover { background: #e4e8ee; }
.button.danger-outline { background: #d84a4a; border-color: #d84a4a; color: white; }
.button.danger-outline:hover { background: #c94141; border-color: #c94141; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; font-size: 13px; }
label, legend { color: var(--ink); font-size: 13px; font-weight: 600; }
input, textarea { width: 100%; min-width: 0; min-height: 40px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: #394255; font-size: 13px; line-height: 1.5; }
input:focus, textarea:focus { border-color: var(--primary); }
input::placeholder { color: #717b8c; }
:is(.search-panel, .sip-search, .history-search) input::placeholder { color: var(--search-placeholder, #707987); font-size: .92em; opacity: 1; }
:is(.search-panel, .sip-search, .history-search) :is(select:has(option[value=""]:checked), .calendar-empty .calendar-trigger span) { color: var(--search-placeholder, #707987); }
:is(.search-panel, .sip-search, .history-search) select option { color: var(--ink); }
textarea { resize: vertical; }
.form-message { min-height: 24px; color: var(--danger); font-size: 13px; line-height: 1.8; }
.form-message.info { color: var(--primary-ink); }
.section-kicker { display: none; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 28px 14px 24px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.main-nav { margin-top: 26px; }
.nav-label { margin: 24px 0 9px; padding: 0 13px; color: var(--ink); font-size: 12px; }
.main-nav a { display: flex; align-items: center; gap: 13px; margin: 4px 0; padding: 11px 13px; border-radius: 10px; font-size: 14px; font-weight: 400; transition: background .15s; }
.main-nav a:hover { background: var(--hover-surface); }
.main-nav a[aria-current] { background: var(--primary-soft); color: var(--primary-ink); }
.main-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; margin-left: var(--sidebar-width); padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.account { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); font-size: 11px; font-weight: 700; flex-shrink: 0; }
.user-name { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.session-label { margin-inline: 12px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.session-label time { margin-left: 5px; color: var(--primary-ink); font-variant-numeric: tabular-nums; }
.workspace { width: calc(100% - var(--sidebar-width)); min-height: calc(100vh - 128px); margin-left: var(--sidebar-width); padding: 30px clamp(16px, 2.1vw, 38px) 40px; }
.sidebar .nav-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.search-panel { padding: 12px 16px; }
.search-panel > form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; }
.search-fields, .management-filters, .search-panel .asis-filters, .search-footer { display: contents; }
.search-panel .field { flex: 0 1 8rem; gap: 4px; }
.search-panel .field.sort-field { flex-basis: 15rem; max-width: 100%; }
.search-panel .field:has(:where(#keyword, .reference-picker)) { flex-basis: 13rem; }
.search-panel .field:has(> select:not([name="sort"])) { flex-basis: 9.5rem; }
.search-panel .field:has(> :is(.calendar-field, input[type="date"], input[type="month"])) { flex-basis: 12.25rem; }
.search-panel .date-field { flex: 0 1 26rem; max-width: 100%; }
.search-panel :is(input:not(.calendar-source), select, .calendar-trigger),
:is(.sip-search, .history-search) input[type="search"] { min-height: 32px; padding: 5px 8px; line-height: 1.35; }
.search-panel .calendar-trigger { gap: 4px; }
.search-panel .calendar-trigger svg { flex-basis: 16px; width: 16px; height: 16px; }
.search-panel form .button-group { margin-inline-start: auto; gap: 6px; }
.search-panel .search-footer > p { order: 1; flex-basis: 100%; margin: 0; font-size: 12px; }
.search-panel + .results-panel { margin-top: 14px; }
.date-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.date-field legend { margin-bottom: 8px; padding: 0; }
.date-inputs { display: flex; align-items: center; gap: 7px; }
.date-inputs input { padding-inline: 8px; }
.date-inputs > .calendar-field { flex: 1 1 0; }
.button-group { display: flex; gap: 8px; }
.results-panel { margin-top: 24px; overflow: hidden; }
.results-heading { display: flex; align-items: center; justify-content: space-between; padding: 20px 23px; }
.result-count { order: -1; margin-inline-end: auto; color: var(--muted); font-size: 13px; }
.count { color: var(--primary-ink); font-size: 15px; }
.results-message { min-height: 0; padding-inline: 23px; }
.results-message:not(:empty) { padding-bottom: 16px; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; text-align: left; }
.workspace .table-scroll table { min-width: 36rem; }
body[data-page="recordings"] .table-scroll table { min-width: 56rem; }
.workspace .table-scroll td { overflow-wrap: anywhere; }
body[data-page="management"] .table-scroll td:last-child:not([colspan]) { width: 1%; white-space: nowrap; }
th { padding: 8px 11px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--row-alt); color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
td { padding: 10px 11px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: var(--row-alt); }
tbody tr:hover { background: var(--hover-surface); }
.empty-state { padding: 65px 20px 75px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 16px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-ink); font-size: 27px; }
.empty-state strong { display: block; font-size: 14px; font-weight: 600; }
.empty-state p { margin-top: 7px; color: var(--muted); font-size: 13px; }
.list-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 8px 15px; min-height: 62px; padding: 14px 23px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.list-footer > span:nth-child(3) { grid-row: 1; grid-column: 2; justify-self: end; text-align: right; }
.list-footer > .pagination { grid-row: 2; grid-column: 1 / -1; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.pagination .page-gap { padding-inline: 4px; color: var(--muted); font-size: 12px; }
.pagination button { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted); font-size: 12px; }
.pagination button[aria-current] { border-color: var(--primary); background: var(--primary); color: white; }
.page-note { margin-top: 17px; color: var(--muted); font-size: 12px; }
.app-footer { display: flex; gap: 12px; justify-content: space-between; margin-left: var(--sidebar-width); padding: 20px 38px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.password-panel { width: 100%; max-width: 28rem; padding: 24px 25px; }
.panel-title { margin: -24px -25px 25px; padding: 20px 25px; border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; background: var(--surface-soft); }
.panel-title p { margin-top: 8px; }
.password-panel form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 16px; }
.password-panel .form-message, .password-actions { grid-column: 1 / -1; }
.password-panel .form-message:empty { display: none; }
.password-panel small { font-size: 12px; }
.password-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 23px -25px -24px; padding: 17px 25px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; background: var(--surface-soft); }
.dialog { width: min(500px, calc(100% - 30px)); max-height: calc(100% - 40px); padding: 0; border: 0; border-radius: 13px; background: var(--surface); color: var(--ink); box-shadow: 0 25px 100px #111b3b35; }
.dialog::backdrop { background: #121c3a66; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 25px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.dialog-heading h2 { font-size: 18px; }
.icon-button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 25px; line-height: 1; }
.icon-button:hover { background: var(--hover-surface); }
.dialog-body { padding: 24px 25px; }
.dialog-body textarea { display: block; margin-top: 10px; }
.dialog-body audio { width: 100%; margin: 20px 0; }
#player-progress { display: block; width: 100%; height: 8px; margin-top: 16px; appearance: none; border: 0; border-radius: 4px; overflow: hidden; background: var(--line); accent-color: var(--primary); }
#player-progress::-webkit-progress-bar { background: var(--line); }
#player-progress::-webkit-progress-value { background: var(--primary); }
#player-progress::-moz-progress-bar { background: var(--primary); }
#player-progress:not([hidden]) + audio { margin-top: 10px; }
.dialog-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 17px 25px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.input-hint { display: flex; justify-content: space-between; margin: 8px 0; color: var(--muted); font-size: 12px; }
.row-button { min-width: 46px; }
.memo-cell { max-width: 210px; overflow-wrap: anywhere; }
.memo-link { padding: 0; border: 0; background: none; color: var(--primary-ink); font: inherit; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.memo-link:hover { text-decoration: underline; }
.memo-cell .edited-row-badge { margin-inline-start: 6px; }
.login-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: radial-gradient(ellipse at 15% 20%, rgba(8, 127, 140, .13), transparent 48%), radial-gradient(ellipse at 90% 85%, rgba(8, 127, 140, .09), transparent 42%), var(--bg); }
.login-layout { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 28px; width: 100%; padding: 65px 20px 55px; }
.login-layout > .brand { justify-content: center; padding: 0; text-align: center; }
.login-layout > .brand strong { font-size: 26px; }
.login-layout > .brand small { font-size: 12px; margin-top: 5px; }
.login-card { width: 100%; max-width: 430px; padding: 34px; background: var(--surface); border-radius: 18px; box-shadow: 0 16px 48px rgba(31, 41, 55, .08); }
.login-title { display: flex; align-items: center; gap: 12px; margin-bottom: 25px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.title-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--primary-soft); color: var(--primary-ink); }
.title-icon svg { width: 22px; height: 22px; }
.login-card .field + .field { margin-top: 20px; }
.login-card input { min-height: 44px; }
.login-remember { margin-top: 16px; }
.login-card .form-message { min-height: 0; margin-top: 12px; }
.login-card .form-message:empty { display: none; }
.login-submit { width: 100%; min-height: 38px; margin-top: 24px; }
.prototype-note { margin-top: 24px; padding-top: 21px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.8; text-align: center; }
.login-footer { padding: 20px; color: var(--muted); font-size: 11px; text-align: center; }
.login-footer span { margin-left: 12px; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 30; padding: 12px; background: var(--surface); }
select { width: 100%; min-width: 0; min-height: 40px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 13px; }
.management-dialog { width: min(820px, calc(100% - 30px)); }
.management-dialog > form { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
.management-dialog .dialog-heading, .management-dialog .dialog-footer { flex-shrink: 0; }
.management-dialog .dialog-body { overflow-y: auto; min-height: 0; }
.management-dialog .editor-record-actions { margin-inline: 0 auto; flex-wrap: wrap; }
.management-dialog .editor-record-actions:not(:has(> button:not([hidden]))) { display: none; }
.editor-section { min-width: 0; margin: 0 0 25px; padding: 0; border: 0; }
.editor-section legend { width: 100%; padding: 0 0 10px; margin-bottom: 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.full-width { grid-column: 1 / -1; }
.editor-grid :disabled { color: var(--ink); opacity: 1; background: var(--surface-soft); }
.status-badge { display: inline-block; padding: 3px 8px; border-radius: 4px; color: var(--primary-ink); background: var(--primary-soft); font-size: 12px; white-space: nowrap; }
.edited-row-badge, .new-row-badge { display: inline-block; align-self: center; margin-inline: 6px; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.edited-row-badge { background: #ffead6; color: #79400f; }
.new-row-badge { background: #dff3e7; color: #23583e; }
[data-theme="dark"] .edited-row-badge { background: #563820; color: #ffdfbd; }
[data-theme="dark"] .new-row-badge { background: #254b3a; color: #d1f1df; }
.edit-action-stack { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; vertical-align: middle; }
.edit-action-stack > :is(.edited-row-badge, .new-row-badge) { margin-inline: 0; }
#manage-rows .button-group { align-items: flex-start; }
.status-badge.removed { color: var(--danger); background: #fff0f0; }
@media (min-width: 1600px) { .workspace { padding-top: 42px; } }
@media (max-width: 1200px) {
    :root { --sidebar-width: 215px; }
    .sidebar { padding-inline: 15px; }
    .workspace { padding: 28px 24px; }
    .app-header { padding-inline: 24px; }
    .session-label { margin-inline: 0; }
}
@media (max-width: 760px) {
    :root { --sidebar-width: 0px; }
    .sidebar { position: static; width: 100%; padding: 20px 16px 0; border-right: 0; border-bottom: 1px solid var(--line); }
    .sidebar .brand { padding-left: 5px; }
    .main-nav { display: flex; gap: 8px; margin-top: 17px; padding-bottom: 10px; overflow-x: auto; }
    .nav-label { display: none; }
    .main-nav a { flex-shrink: 0; margin: 0; padding: 9px 12px; font-size: 13px; }
    .app-header { min-height: 62px; height: auto; padding: 14px 18px; }
    .account { width: 100%; gap: 8px; }
    .session-label { margin-left: auto; }
    .workspace { min-height: calc(100vh - 268px); padding: 24px 16px; }
    h1 { font-size: 22px; }
    .page-heading { margin-bottom: 21px; padding-bottom: 18px; }
    .search-panel { padding: 10px 12px; }
    .button-group { margin-left: auto; }
    .results-heading { padding: 17px; }
    .results-heading > .muted { font-size: 11px; }
    .list-footer { padding-inline: 17px; }
    .password-panel { padding: 22px 18px; }
    .panel-title { margin: -22px -18px 22px; padding: 18px; }
    .password-actions { margin: 22px -18px -22px; padding: 17px 18px; }
    .app-footer { padding: 18px 16px; font-size: 10px; }
    .dialog-body { padding: 20px; }
    .editor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 440px) {
    .search-panel .field { flex: 1 1 calc(50% - 5px); }
    .search-panel .date-field, .search-panel .field:has(.reference-picker) { flex-basis: 100%; }
}
@media (max-width: 360px) {
    .date-inputs { flex-wrap: wrap; gap: 4px; }
    .date-inputs > .calendar-field { flex-basis: 100%; }
    .date-inputs > span { display: none; }
}
@media (max-width: 480px) {
    .avatar { display: none; }
    .user-name { max-width: 95px; }
    .session-label { font-size: 10px; }
    .account .button { min-width: 58px; padding-inline: 7px; font-size: 12px; }
    .login-layout { padding: 35px 16px; gap: 22px; }
    .login-layout > .brand strong { font-size: 22px; }
    .login-card { padding: 27px 23px; }
}
