#mapInfo
{
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

#mapToolbar
{
    position: relative;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 3px 0 4px;
    font-size: 12px;
    text-align: left;
}

#mapToolbar > * { flex-shrink: 0; }
#mapToolbar > label { white-space: nowrap; }
#mapToolbar #searchStr { width: 100px; height: 20px; margin: 0; padding: 0 4px; }
#mapToolbar #searchBtn { margin: 0 !important; }
#mapToolbar #centerX,
#mapToolbar #centerY
{
    width: 84px;
    height: 20px;
    text-align: center;
    margin: 0;
    padding: 0 3px;
    border: 1px solid #cc9441;
}

#mapToolbar #mapViewToggle { margin: 0 0 0 4px; }
#mapToolbar #copyMapCenter { width: 40px; height: 20px; margin: 0; padding: 0; }

.manager-appearance-controls,
.manager-theme-controls
{
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.manager-theme-controls { gap: 2px; }
.manager-theme-controls > label
{
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 5px;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
}
.manager-theme-controls > label > input { margin: 2px 0 0; }
.map-provider-control { position: relative; margin-left: 6px; }
#managerMapStatus,
#mapCoordinateCopyStatus
{
    position: absolute;
    top: calc(100% + 4px);
    z-index: 40;
    width: max-content;
    max-width: min(360px, 75vw);
    padding: 4px 8px;
    border: 1px solid var(--theme-control-border);
    border-radius: 4px;
    color: var(--theme-body-fg);
    background: var(--theme-panel-bg);
}
#managerMapStatus { right: 0; }
#mapCoordinateCopyStatus { left: 8px; }
#managerMapStatus:empty,
#mapCoordinateCopyStatus:empty { display: none; }
#mapToolbar .map-option-label { font-size: 12px; padding: 0; font-weight: normal; margin: -2px 0 0 4px; }
#mapToolbar .map-option-label input { width: 18px; height: 18px; margin: 2px 0 0 0; }

:is(#mainWorkspaceToggle, #mapProviderToggle)
{
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    box-sizing: border-box;
    height: 22px;
    padding: 1px;
    border: 1px solid var(--theme-control-border);
    border-radius: 12px;
    background: var(--theme-control-bg);
    color: var(--theme-control-fg);
    cursor: pointer;
}

#mainWorkspaceToggle { width: 126px; }
#mapProviderToggle { width: 106px; }

body:is(.cheongju-console, .chuncheon-console)
{
    --map-provider-surface: var(--theme-control-bg);
    --map-provider-border: var(--theme-control-border);
}

body:is(.cheongju-console, .chuncheon-console) #mapProviderToggle
{
    --theme-control-bg: var(--map-provider-surface);
}

body:is(.cheongju-console, .chuncheon-console):not(.light) #mapProviderToggle
{
    --theme-control-border: var(--map-provider-border);
}

body.cheongju-console #mapProviderToggle:enabled
{
    background: var(--theme-control-readonly-bg);
    background: color-mix(in srgb, var(--theme-control-readonly-bg) 70%, var(--console-shell-bg));
}

:is(#mainWorkspaceToggle, #mapProviderToggle)::before
{
    content: '';
    position: absolute;
    inset: 1px auto 1px 1px;
    width: calc((100% - 2px) / 2);
    border-radius: 10px;
    background: #2563b9;
    transition: transform .16s ease;
}

:is(#mainWorkspaceToggle, #mapProviderToggle) > span
{
    position: relative;
    line-height: 18px;
    text-align: center;
    font-size: 12px;
    white-space: nowrap;
}
:is(#mainWorkspaceToggle, #mapProviderToggle)[aria-checked='true']::before { transform: translateX(100%); }
#mainWorkspaceToggle[aria-checked='true'] .workspace-auto-label,
#mainWorkspaceToggle[aria-checked='false'] .workspace-map-label,
#mapProviderToggle[aria-checked='true'] .map-provider-naver,
#mapProviderToggle[aria-checked='false'] .map-provider-kakao { color: #fff; font-weight: 700; }
:is(#mainWorkspaceToggle, #mapProviderToggle):focus-visible { outline: 2px solid var(--theme-focus-ring, #3b82f6); outline-offset: 2px; }
#mapProviderToggle::before { background: var(--console-primary, var(--theme-accent, #2563b9)); }
#mapProviderToggle:disabled { cursor: default; opacity: .7; }
#mapProviderToggle[aria-busy='true'] { cursor: wait; }

@media (max-width: 1450px)
{
    #mainPage > .main-header-bar { height: auto; min-height: 38px; flex-wrap: wrap; row-gap: 3px; }
}

#mainMapCanvas { flex: 1; min-height: 0; position: relative; overflow: hidden; }
#managerRoutePanel
{
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    z-index: 15;
    padding: 3px 4px 3px 8px;
    border: 1px solid var(--theme-control-border);
    border-radius: 5px;
    background: var(--theme-panel-bg);
    color: var(--theme-body-fg);
}
#managerRoutePanel[hidden] { display: none; }
#clearManagerRoute
{
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--theme-control-border);
    border-radius: 3px;
    background: var(--theme-control-bg);
    color: var(--theme-control-fg);
    font-size: 17px;
    line-height: 18px;
    cursor: pointer;
}
.manager-route-endpoint
{
    display: block;
    position: relative;
    width: max-content;
    padding: 3px 6px;
    border: 1px solid #fff;
    border-radius: 5px;
    transform: translate(-50%, calc(-100% - 3px));
    background: #2256a8;
    color: #fff;
    font-size: 12px;
    line-height: 16px;
    pointer-events: none;
}
.manager-route-endpoint::after
{
    position: absolute;
    top: 100%;
    left: calc(50% - 4px);
    width: 8px;
    height: 4px;
    background: inherit;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    content: '';
}
.manager-route-end { background: #a13638; }

#mapInfo.is-auto-reception .map-only-control,
#mapInfo.is-auto-reception #mainMapCanvas,
#autoReceptionPanel[hidden] { display: none !important; }

#autoReceptionPanel
{
    display: grid;
    grid-template-columns: 265px minmax(0, 1fr);
    flex: 1;
    min-height: 0;
    border: 1px solid var(--theme-panel-border);
    background: var(--theme-panel-bg);
    color: var(--theme-body-fg);
    text-align: left;
    font-size: 12px;
    overflow: hidden;
}

.auto-reception-list { min-width: 0; min-height: 0; overflow: hidden; border-right: 1px solid var(--theme-panel-border); }
.auto-reception-list-scroll { height: 100%; overflow: auto; }
#autoReceptionTable { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 0; }
#autoReceptionTable .auto-reception-time { width: 64px; }
#autoReceptionTable .auto-reception-number { width: 140px; }
#autoReceptionTable .auto-reception-state { width: 60px; }
#autoReceptionTable th,
#autoReceptionTable td { height: 28px; box-sizing: border-box; padding: 4px 6px; text-align: center !important; vertical-align: middle; font-size: 12px; font-weight: normal; white-space: nowrap; border-bottom: 1px solid var(--theme-tabulator-row-border); }
#autoReceptionTable th { position: sticky; top: 0; z-index: 1; background: var(--theme-panel-header-bg); color: var(--theme-panel-header-fg); font-weight: 600; }
#autoReceptionTable tbody tr { cursor: pointer; background: var(--theme-tabulator-row-bg); color: var(--theme-tabulator-row-fg); }
#autoReceptionTable tbody tr:hover { background: var(--theme-tabulator-row-bg-hover); color: var(--theme-tabulator-row-fg); }
#autoReceptionTable tbody tr[aria-selected='true'] { background: var(--theme-tabulator-row-bg-selected); color: var(--theme-tabulator-row-fg-selected); }
#autoReceptionTable tbody tr:focus-visible { outline: 2px solid #3b82f6; outline-offset: -2px; }
#autoReceptionTable td.auto-reception-phone-cell { padding: 4px; }
.auto-reception-recording { display: grid; grid-template-columns: 18px minmax(0, 1fr) 18px; align-items: center; gap: 2px; width: 100%; }
.auto-reception-recording-phone { min-width: 0; white-space: nowrap; text-align: center; }
#autoReceptionTable .auto-reception-recording-button { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 18px; height: 20px; margin: 0; padding: 0; border: 1px solid var(--theme-control-border); border-radius: 4px; background: var(--theme-control-bg); color: var(--theme-control-fg); cursor: pointer; }
#autoReceptionTable .auto-reception-recording-button i { font-size: 9px; pointer-events: none; }
#autoReceptionTable .auto-reception-recording-button:hover:enabled { background: var(--theme-button-bg-hover); color: var(--theme-button-fg); }
#autoReceptionTable .auto-reception-recording-button:focus-visible { outline: 2px solid #3b82f6; outline-offset: 1px; }
#autoReceptionTable .auto-reception-recording-button:disabled { opacity: .4; cursor: default; }
#autoReceptionTable .auto-reception-recording-button.is-playing { color: var(--theme-danger-fg); }
.auto-reception-detail { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.auto-reception-detail-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex: 0 0 auto; min-height: 28px; padding: 4px 10px; border-bottom: 1px solid var(--theme-panel-border); background: var(--theme-panel-header-bg); color: var(--theme-panel-header-fg); }
.auto-reception-detail-header strong { font-size: 12px; font-weight: 600; }
#autoReceptionPhone { white-space: nowrap; font-size: 12px; }
#autoReceptionTranscript { flex: 1; min-height: 0; padding: 12px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; font-size: 14px; text-align: left; }
.auto-reception-empty { margin: 0; padding: 16px 8px; text-align: center; color: var(--theme-label-fg); font-size: 12px; font-weight: normal; }

#autoReceptionRows .auto-reception-failed td:last-child { color: var(--theme-danger-fg); font-weight: 700; }
#autoReceptionRows .auto-reception-failed[aria-selected='true'] td:last-child { color: var(--theme-tabulator-row-fg-selected); }
#autoReceptionRows .auto-reception-failed td:first-child { box-shadow: inset 3px 0 var(--theme-danger-fg); }
.auto-reception-progress { padding: 6px 8px; border-left: 3px solid var(--theme-control-focus-border); background: var(--theme-panel-header-bg); font-weight: 700; }
.auto-reception-progress.is-failed { border-color: var(--theme-danger-fg); color: var(--theme-danger-fg); }
.auto-reception-failure, .auto-reception-address { margin: 6px 0; font-size: 12px; color: var(--theme-label-fg); }
.auto-reception-dialog { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--theme-tabulator-row-border); }
.auto-reception-speaker { flex: 0 0 30px; font-size: 11px; color: var(--theme-label-fg); }
.auto-reception-dialog p { margin: 0; min-width: 0; white-space: pre-wrap; }
.auto-reception-dialog.is-customer p { font-weight: 700; }

@media (prefers-reduced-motion: reduce)
{
    :is(#mainWorkspaceToggle, #mapProviderToggle)::before { transition: none; }
}
